from 定義要拷貝的源文件 from:__dirname+'/src/components'
to 定義要拷貝到的目標(biāo)文件夾 to: __dirname+'/dist'
toType file 或者 dir 可選碰酝,默認(rèn)是文件
force 強(qiáng)制覆蓋前面的插件 可選全庸,默認(rèn)是文件
context 可選勒魔,默認(rèn)base context可用specific context
flatten 只拷貝指定的文件 可以用模糊匹配
ignore 忽略拷貝指定的文件 可以模糊匹配
用法
const CopyWebpackPlugin=require('copy-webpack-plugin');
new CopyWebpackPlugin([
{
from: __dirname+'/src/components',
to: __dirname+'/dist',
ignore: ['.*']
}
])