mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
feat(nuxt.config.js): support chunkFileName in config
This commit is contained in:
parent
8682aa2d01
commit
f22c16a7a4
@ -35,6 +35,7 @@ export default function webpackBaseConfig ({ isClient, isServer }) {
|
|||||||
output: {
|
output: {
|
||||||
path: resolve(this.options.buildDir, 'dist'),
|
path: resolve(this.options.buildDir, 'dist'),
|
||||||
filename: this.options.build.filenames.app,
|
filename: this.options.build.filenames.app,
|
||||||
|
chunkFilename: this.options.build.filenames.chunk,
|
||||||
publicPath: (isUrl(this.options.build.publicPath)
|
publicPath: (isUrl(this.options.build.publicPath)
|
||||||
? this.options.build.publicPath
|
? this.options.build.publicPath
|
||||||
: urlJoin(this.options.router.base, this.options.build.publicPath))
|
: urlJoin(this.options.router.base, this.options.build.publicPath))
|
||||||
|
@ -122,6 +122,7 @@ export default function webpackClientConfig () {
|
|||||||
// 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.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()
|
||||||
|
@ -104,7 +104,8 @@ Options.defaults = {
|
|||||||
css: 'common.[chunkhash].css',
|
css: 'common.[chunkhash].css',
|
||||||
manifest: 'manifest.[hash].js',
|
manifest: 'manifest.[hash].js',
|
||||||
vendor: 'vendor.bundle.[chunkhash].js',
|
vendor: 'vendor.bundle.[chunkhash].js',
|
||||||
app: 'nuxt.bundle.[chunkhash].js'
|
app: 'nuxt.bundle.[chunkhash].js',
|
||||||
|
chunk: '[id].nuxt.bundle.[chunkhash].js'
|
||||||
},
|
},
|
||||||
vendor: [],
|
vendor: [],
|
||||||
plugins: [],
|
plugins: [],
|
||||||
|
Loading…
Reference in New Issue
Block a user