webpack基础(九)小插件
2019-05-25 本文已影响0人
前端开发爱好者
cleanWebpackPlugin
用于在输出目录前删除之前打包的目录
yarn add clean-webpack-plugin
plugins: [
new CleanWebpackPlugin({
path: './build'
})
]
copyWebpackPlugin
yarn add copy-webpack-plgin -D
new CopyWebpackPlugin([
{from: './doc', to: './'}
])
bannerWebpackPlugin (内置)
版权声明
总结
plugins: [
new CleanWebpackPlugin({
path: './build'
}),
new CopyWebpackPlugin([
{from: './doc', to: './'}
]),
new webpack.BannerPlugin('make 2019')
]