mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Use getFilename for url-loader assets (#3759)
Now they get [name] removed in production.
This commit is contained in:
parent
432720b8c8
commit
715df92eac
@ -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')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -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: [],
|
||||
|
Loading…
Reference in New Issue
Block a user