|
@@ -6,11 +6,13 @@ const {
|
|
|
CleanWebpackPlugin
|
|
|
} = require('clean-webpack-plugin'); //清除文件夹
|
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin'); //复制文件
|
|
|
+const webpackVersion = new Date().getTime();
|
|
|
module.exports = {
|
|
|
mode: 'production',
|
|
|
output: {
|
|
|
path: path.resolve(__dirname, './../dist'),
|
|
|
- filename: 'js/[name].min.js'
|
|
|
+ filename: 'js/[name].[chunkhash].' + webpackVersion + '.min.js',
|
|
|
+ chunkFilename: 'js/[id].[chunkhash].' + webpackVersion + '.min.js'
|
|
|
},
|
|
|
plugins: [
|
|
|
new CleanWebpackPlugin(),
|