mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-12 03:38:07 +00:00
improve webpack chunk namings
This commit is contained in:
parent
db19b50a02
commit
e510136a5a
@ -119,10 +119,11 @@ export default function webpackClientConfig () {
|
|||||||
// Add friendly error plugin
|
// Add friendly error plugin
|
||||||
config.plugins.push(new FriendlyErrorsWebpackPlugin())
|
config.plugins.push(new FriendlyErrorsWebpackPlugin())
|
||||||
|
|
||||||
|
// https://webpack.js.org/plugins/named-modules-plugin
|
||||||
|
config.plugins.push(new webpack.NamedModulesPlugin())
|
||||||
|
|
||||||
// Add HMR support
|
// Add HMR support
|
||||||
config.entry.app = ['webpack-hot-middleware/client?name=$client&reload=true', config.entry.app]
|
config.entry.app = ['webpack-hot-middleware/client?name=$client&reload=true', config.entry.app]
|
||||||
config.output.filename = '[name].js'
|
|
||||||
config.output.chunkFilename = '[id].js'
|
|
||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
new webpack.HotModuleReplacementPlugin(),
|
new webpack.HotModuleReplacementPlugin(),
|
||||||
new webpack.NoEmitOnErrorsPlugin()
|
new webpack.NoEmitOnErrorsPlugin()
|
||||||
@ -143,6 +144,9 @@ export default function webpackClientConfig () {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// https://webpack.js.org/plugins/hashed-module-ids-plugin
|
||||||
|
config.plugins.push(new webpack.HashedModuleIdsPlugin())
|
||||||
|
|
||||||
// Webpack Bundle Analyzer
|
// Webpack Bundle Analyzer
|
||||||
if (this.options.build.analyze) {
|
if (this.options.build.analyze) {
|
||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
|
@ -159,9 +159,9 @@ Options.defaults = {
|
|||||||
filenames: {
|
filenames: {
|
||||||
css: 'common.[contenthash].css',
|
css: 'common.[contenthash].css',
|
||||||
manifest: 'manifest.[hash].js',
|
manifest: 'manifest.[hash].js',
|
||||||
vendor: 'vendor.bundle.[chunkhash].js',
|
vendor: 'vendor.[chunkhash].js',
|
||||||
app: 'nuxt.bundle.[chunkhash].js',
|
app: 'app.[chunkhash].js',
|
||||||
chunk: '[id].nuxt.bundle.[chunkhash].js'
|
chunk: '[name].[chunkhash].js'
|
||||||
},
|
},
|
||||||
vendor: [],
|
vendor: [],
|
||||||
plugins: [],
|
plugins: [],
|
||||||
|
Loading…
Reference in New Issue
Block a user