From d901bb6a38b5f9bb80527c84b83af120e9f768b7 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Sun, 24 Nov 2019 16:00:39 +0100 Subject: [PATCH] Replaced UglifyJS with Terser. --- package.json | 2 +- webpack.config.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3480a19d09..b3ae9d417c 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "postcss-loader": "^3.0.0", "raw-loader": "^3.1.0", "style-loader": "^1.0.0", - "uglifyjs-webpack-plugin": "^1.3.0", + "terser-webpack-plugin": "^2.2.1", "webpack": "^4.39.1", "webpack-cli": "^3.3.6" }, diff --git a/webpack.config.js b/webpack.config.js index c9b6b9e450..ec742b6910 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -11,7 +11,7 @@ const path = require( 'path' ); const webpack = require( 'webpack' ); const { bundler, styles } = require( '@ckeditor/ckeditor5-dev-utils' ); const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' ); -const UglifyJsWebpackPlugin = require( 'uglifyjs-webpack-plugin' ); +const TerserPlugin = require( 'terser-webpack-plugin' ); module.exports = { devtool: 'source-map', @@ -31,14 +31,15 @@ module.exports = { optimization: { minimizer: [ - new UglifyJsWebpackPlugin( { + new TerserPlugin( { sourceMap: true, - uglifyOptions: { + terserOptions: { output: { // Preserve CKEditor 5 license comments. comments: /^!/ } - } + }, + extractComments: false } ) ] },