1. 程式人生 > >babel-preset-es2015安裝

babel-preset-es2015安裝

npm install --save-dev babel-preset-es2

安裝完成後專案目錄下新建

vi .babelrc
{
  "presets": ["es2015","stage-0"],
  "plugins": [
    ["transform-runtime", {
      "polyfill": false,
      "regenerator": true
    }]
  ]
}


相關解釋https://excaliburhan.com/post/babel-preset-and-plugins.html