Skip to content

Instantly share code, notes, and snippets.

@starikovm
Created October 24, 2019 14:30
Show Gist options
  • Select an option

  • Save starikovm/7d5423052d695f78279874924cf93e9b to your computer and use it in GitHub Desktop.

Select an option

Save starikovm/7d5423052d695f78279874924cf93e9b to your computer and use it in GitHub Desktop.
webpack extension config
build: {
parallel: true,
terser: true,
extend(config, ctx) {
if (process.env.NODE_ENV !== 'production') {
config.devtool = '#source-map';
}
if (ctx.isDev && ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/,
});
}
if (
config.optimization.splitChunks &&
typeof config.optimization.splitChunks === 'object'
) {
config.optimization.splitChunks.maxSize = 200000;
}
},
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment