我正在学习webpack 4,但遇到一些错误。 这是我的webpack.config.js
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './src/index.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist')
}
module:{
rules:[
{test:/\.css$/, use:['style-loader','css-loader']}
]
}
};
这是错误:
module:{
^^^^^^
SyntaxError: Unexpected identifier
at NativeCompileCache._moduleCompile (/Users/meifei/Documents/learn-webpack/node_modules/v8-compile-cache/v8-compile-cache.js:226:18)