diff --git a/lib/builder/webpack/base.js b/lib/builder/webpack/base.js index 3c96e04992..685b866fa3 100644 --- a/lib/builder/webpack/base.js +++ b/lib/builder/webpack/base.js @@ -49,7 +49,7 @@ export default class WebpackBaseConfig { // Don't use hashes when watching // https://github.com/webpack/webpack/issues/1914#issuecomment-174171709 if (this.options.dev) { - fileName = fileName.replace(/\[(chunkhash|contenthash|hash)\]\./g, '') + fileName = fileName.replace(/\[(chunkhash|contenthash|hash)(?::(\d+))?\]\./g, '') } // Don't use [name] for production assets @@ -185,7 +185,7 @@ export default class WebpackBaseConfig { loader: 'url-loader', options: { limit: 1000, // 1KO - name: 'img/[name].[hash:7].[ext]' + name: this.getFileName('img') } }) }, @@ -195,7 +195,7 @@ export default class WebpackBaseConfig { loader: 'url-loader', options: { limit: 1000, // 1 KO - name: 'fonts/[name].[hash:7].[ext]' + name: this.getFileName('font') } }) }, @@ -204,7 +204,7 @@ export default class WebpackBaseConfig { use: perfLoader.pool('assets', { loader: 'file-loader', options: { - name: 'videos/[name].[hash:7].[ext]' + name: this.getFileName('video') } }) } diff --git a/lib/common/nuxt.config.js b/lib/common/nuxt.config.js index 3edfb23b2f..aea4834b6b 100644 --- a/lib/common/nuxt.config.js +++ b/lib/common/nuxt.config.js @@ -53,7 +53,10 @@ export default { filenames: { app: '[name].[contenthash].js', chunk: '[name].[contenthash].js', - css: '[name].[contenthash].css' + css: '[name].[contenthash].css', + img: 'img/[name].[hash:7].[ext]', + font: 'fonts/[name].[hash:7].[ext]', + video: 'videos/[name].[hash:7].[ext]' }, styleResources: {}, plugins: [],