mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-26 14:37:52 +02:00
chore(v2): switch from uglifyjs-webpack-plugin to terser-webpack-plugin (#1099)
This commit is contained in:
parent
8695ed89a6
commit
fc7ba5b6b1
3 changed files with 148 additions and 21 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
const Config = require('webpack-chain');
|
||||
const CSSExtractPlugin = require('mini-css-extract-plugin');
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const path = require('path');
|
||||
|
||||
const mdLoader = require.resolve('./loaders/markdown');
|
||||
|
@ -154,15 +154,17 @@ module.exports = function createBaseConfig(props, isServer) {
|
|||
|
||||
if (isProd) {
|
||||
config.optimization.minimizer([
|
||||
new UglifyJsPlugin({
|
||||
new TerserPlugin({
|
||||
cache: true,
|
||||
uglifyOptions: {
|
||||
warnings: false,
|
||||
compress: false,
|
||||
parallel: true,
|
||||
sourceMap: true,
|
||||
terserOptions: {
|
||||
ecma: 6,
|
||||
mangle: true,
|
||||
output: {
|
||||
comments: false,
|
||||
},
|
||||
},
|
||||
sourceMap: true,
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue