初学webpack,用babel将es6转化为es5时报错:ERROR in ./entry.jsModule build failed: Error: Cannot find module 'core-js/library/fn/get-iterator'重装babel-core也不管用webpack配置为:module.exports = { entry: './entry.js', output: { filename: 'bundle.js' }, //devtool: 'source-map', module: { loaders: [{ test: /\.css$/, loader: 'style-loader!css-loader' },{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' }] }}.babelrc内容为:{"presets": ["es2015"]}entry.js为:var a = require('./a.js');require('./index.css');let app = document.getElementById('app');app.innerHTML = '<p>hello webpack!</p>' + a.a;
添加回答
举报
0/150
提交
取消