有没有办法通过CopyWebpackPlugin “from”中的数组设置文件路径。我的意思是这样的
new CopyWebpackPlugin([
{
from: [
'./dir1/file1',
'./dir2/file2',
],
to: 'assets/'
}
])
Run Code Online (Sandbox Code Playgroud)
您不能使用数组,但可以使用minimatch 中的globs
所以类似这样的事情会起作用。
new CopyWebpackPlugin([
{ from: './+(dir1|dir2)/+(file1|file2)', to: 'assets/' },
])
Run Code Online (Sandbox Code Playgroud)
或者你只是定义多个 from to
new CopyWebpackPlugin([
{ from: './dir1/file1', to: 'assets/' },
{ from: './dir2/file2', to: 'assets/' },
])
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1391 次 |
| 最近记录: |