mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
perf: improve uglify plugin options
This commit is contained in:
parent
49d59c68f8
commit
2996160151
@ -136,20 +136,23 @@ export default function webpackClientConfig() {
|
|||||||
|
|
||||||
// Minify JS
|
// Minify JS
|
||||||
// https://github.com/webpack-contrib/uglifyjs-webpack-plugin
|
// https://github.com/webpack-contrib/uglifyjs-webpack-plugin
|
||||||
config.plugins.push(
|
if (this.options.build.uglify !== false) {
|
||||||
new UglifyJSPlugin({
|
config.plugins.push(
|
||||||
cache: true,
|
new UglifyJSPlugin(Object.assign({
|
||||||
sourceMap: true,
|
cache: true,
|
||||||
extractComments: {
|
sourceMap: true,
|
||||||
filename: 'LICENSES'
|
parallel: true,
|
||||||
},
|
extractComments: {
|
||||||
uglifyOptions: {
|
filename: 'LICENSES'
|
||||||
output: {
|
},
|
||||||
comments: /^\**!|@preserve|@license|@cc_on/
|
uglifyOptions: {
|
||||||
|
output: {
|
||||||
|
comments: /^\**!|@preserve|@license|@cc_on/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}, this.options.build.uglify))
|
||||||
})
|
)
|
||||||
)
|
}
|
||||||
|
|
||||||
// Webpack Bundle Analyzer
|
// Webpack Bundle Analyzer
|
||||||
if (this.options.build.analyze) {
|
if (this.options.build.analyze) {
|
||||||
|
@ -198,6 +198,7 @@ Options.defaults = {
|
|||||||
extractCSS: false,
|
extractCSS: false,
|
||||||
cssSourceMap: undefined,
|
cssSourceMap: undefined,
|
||||||
ssr: undefined,
|
ssr: undefined,
|
||||||
|
uglify: {},
|
||||||
publicPath: '/_nuxt/',
|
publicPath: '/_nuxt/',
|
||||||
filenames: {
|
filenames: {
|
||||||
css: 'vendor.[contenthash].css',
|
css: 'vendor.[contenthash].css',
|
||||||
|
Loading…
Reference in New Issue
Block a user