mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(webpack): enable minimize for client production bundles (#404)
This commit is contained in:
parent
403ee671eb
commit
5a1ccec61f
@ -291,7 +291,7 @@ export default {
|
|||||||
optimization: {
|
optimization: {
|
||||||
runtimeChunk: 'single',
|
runtimeChunk: 'single',
|
||||||
/** Set minimize to false to disable all minimizers. (It is disabled in development by default) */
|
/** Set minimize to false to disable all minimizers. (It is disabled in development by default) */
|
||||||
minimize: { $resolve: (val, get) => val ?? get('dev') },
|
minimize: { $resolve: (val, get) => val ?? !get('dev') },
|
||||||
/** You can set minimizer to a customized array of plugins. */
|
/** You can set minimizer to a customized array of plugins. */
|
||||||
minimizer: undefined,
|
minimizer: undefined,
|
||||||
splitChunks: {
|
splitChunks: {
|
||||||
|
@ -71,14 +71,7 @@ function clientHMR (ctx: WebpackConfigContext) {
|
|||||||
config.plugins.push(new webpack.HotModuleReplacementPlugin())
|
config.plugins.push(new webpack.HotModuleReplacementPlugin())
|
||||||
}
|
}
|
||||||
|
|
||||||
function clientOptimization (ctx: WebpackConfigContext) {
|
function clientOptimization (_ctx: WebpackConfigContext) {
|
||||||
const { options, config } = ctx
|
|
||||||
|
|
||||||
config.optimization = {
|
|
||||||
...config.optimization,
|
|
||||||
...options.build.optimization as any
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Improve optimization.splitChunks.cacheGroups
|
// TODO: Improve optimization.splitChunks.cacheGroups
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user