防止重名图片被覆盖
Showing
1 changed file
with
14 additions
and
0 deletions
| ... | @@ -40,6 +40,20 @@ module.exports = { | ... | @@ -40,6 +40,20 @@ module.exports = { | 
| 40 | .end() | 40 | .end() | 
| 41 | }) | 41 | }) | 
| 42 | 42 | ||
| 43 | const imagesRule = config.module.rule('images') | ||
| 44 | imagesRule.uses.clear() | ||
| 45 | imagesRule.use('file-loader') | ||
| 46 | .loader('url-loader') | ||
| 47 | .options({ | ||
| 48 | limit: 10000, | ||
| 49 | fallback: { | ||
| 50 | loader: 'file-loader', | ||
| 51 | options: { | ||
| 52 | name: 'img/[name].[hash:8].[ext]' | ||
| 53 | } | ||
| 54 | } | ||
| 55 | }) | ||
| 56 | |||
| 43 | }, | 57 | }, | 
| 44 | configureWebpack: { // webpack 配置 | 58 | configureWebpack: { // webpack 配置 | 
| 45 | // 修改打包后js文件名 | 59 | // 修改打包后js文件名 | ... | ... | 
- 
Please register or sign in to post a comment