webpack4 打包报错 :regeneratorRuntime is not defined

使用async函数,在webpack打包时报错css

babel-polyfill is required. You must also install it in order to get async/await working.webpack

须要加入babel-polyfillweb

npm i -D babel-polyfill

这里有个小插曲,经测试发现yarn 没法安装css-loader 1.0.0,npm

并且若先用npm安装完css-loader后用yarn安装其余包也会报错,可用npm安装babel

在webpack.config.js 的entry选项中async

1 entry: ['babel-polyfill',join("./src/main.js")],

 

参考连接:https://stackoverflow.com/questions/33527653/babel-6-regeneratorruntime-is-not-defined函数

相关文章
相关标签/搜索