webpack小插件
clean-webpack-plugin 可清除原打包文件
1
2
3
4
5
6
7
8const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const webpackConfig = {
plugins: [
new CleanWebpackPlugin(),
],
};
module.exports = webpackConfig;copy-webpack-plugin 可拷贝文件
1
2
3new CopyWebpackPlugin([
{from: 'src', to: './'}
])BannerPlugin 在打包的文件开始处添加信息(webpack内置)
1
2const webpack = require('webpack')
new webpack.BannerPlugin('make by csr hhh')