style:webpack打包缓存
Showing
1 changed file
with
5 additions
and
0 deletions
1 | 'use strict' | 1 | 'use strict' |
2 | const path = require('path') | 2 | const path = require('path') |
3 | const Timestamp = new Date().getTime(); | ||
3 | function resolve (dir) { | 4 | function resolve (dir) { |
4 | return path.join(__dirname, dir) | 5 | return path.join(__dirname, dir) |
5 | } | 6 | } |
... | @@ -63,6 +64,10 @@ module.exports = { | ... | @@ -63,6 +64,10 @@ module.exports = { |
63 | '@': resolve('src') | 64 | '@': resolve('src') |
64 | } | 65 | } |
65 | }, | 66 | }, |
67 | output: { // 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳】 | ||
68 | filename: `static/js/[name].${Timestamp}.js`, | ||
69 | chunkFilename: `static/js/[name].${Timestamp}.js` | ||
70 | }, | ||
66 | devtool: process.env.NODE_ENV === 'development' ? '#eval-source-map' : false | 71 | devtool: process.env.NODE_ENV === 'development' ? '#eval-source-map' : false |
67 | }, | 72 | }, |
68 | // chainWebpack通过链式编程的形式,来修改默认的webpack配置 | 73 | // chainWebpack通过链式编程的形式,来修改默认的webpack配置 | ... | ... |
-
Please register or sign in to post a comment