是否有办法通过 CopyWebpackPlugin “中的数组来设置文件路径”。我的意思是这样的
new CopyWebpackPlugin([
{
from: [
'./dir1/file1',
'./dir2/file2',
],
to: 'assets/'
}
])
答案 0 :(得分:2)
您无法使用数组,但来自minimatch的数据 所以这样的事情会起作用。
new CopyWebpackPlugin([
{ from: './+(dir1|dir2)/+(file1|file2)', to: 'assets/' },
])
或者您只需定义多个来自
new CopyWebpackPlugin([
{ from: './dir1/file1', to: 'assets/' },
{ from: './dir2/file2', to: 'assets/' },
])