[转]CopyPlugin Invalid Options options should be array ValidationError: CopyPlugin Invalid Options
这个错误是使用webpack的一个plugin出现的错误。
这个plugin是copy-webpack-plugin
我把文档的例子复制,然后就报了这个错误。
文档的例子:
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
plugins: [
new CopyPlugin({
patterns: [
{ from: "source", to: "dest" },
{ from: "other", to: "public" },
],
options: {
concurrency: 100,
},
}),
],
};
这个错误说的是这个CopyPlugin构造函数接收到的参数不合法,它需要传入一个array。
plugins: [ new CleanWebpackPlugin(), new HtmlWebpackPlugin({ template: "./public/index.html", chunks: ["main"] }), new CopyPlugin([{ from: "./public/img", to: "./img" }]), ]
原文链接:CopyPlugin Invalid Options options should be array ValidationError: CopyPlugin Invalid Options

浙公网安备 33010602011771号