plugins: [
//plugins的配置
new ESLintPlugin({
//检测src下的文件
context: path.resolve(__dirname, “…/src”),
}),
new HtmlWebpackPlugin({
//模板:以public/index.html文件创建新的html文件
//新的html文件特点:1,结构和原来一致 2,自动引入打包输出的资源
template: path.resolve(__dirname, “…/public/main.html”),
}),
new MiniCssExtractPlugin({
filename: “static/css/main.css”,
}),
,
],
Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration.plugins[4] should be one of these:
-> Plugin of type object or instanceof Function.
Details:- configuration.plugins[4] should be an object:
object { apply, … }
-> Plugin instance. - configuration.plugins[4] should be an instance of function.
-> Function acting as plugin.
- configuration.plugins[4] should be an object:
错误提示无效的配置,在第4个,而我的配置上面只有3个,第4个是多了个逗号,还是得细心