From d89bcd87006de47b9e9df22c8388f93be462487a Mon Sep 17 00:00:00 2001 From: Maciej Bukowski Date: Fri, 29 Jun 2018 14:32:57 +0200 Subject: [PATCH 1/6] Switched to webpack@4.12 and UglifyJsWebpackPlugin. --- bin/build-ckeditor.sh | 2 +- package.json | 10 +++++----- webpack.config.js | 22 ++++++++++++++++------ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/bin/build-ckeditor.sh b/bin/build-ckeditor.sh index 492e932f31..d795a2784f 100755 --- a/bin/build-ckeditor.sh +++ b/bin/build-ckeditor.sh @@ -3,7 +3,7 @@ echo "Building 'build/ckeditor.js'..." echo "" -webpack +webpack --mode production echo "" echo "Done." diff --git a/package.json b/package.json index e38dd9ba21..a28672c7b9 100644 --- a/package.json +++ b/package.json @@ -45,12 +45,12 @@ "@ckeditor/ckeditor5-paragraph": "^10.0.1", "@ckeditor/ckeditor5-theme-lark": "^10.1.0", "@ckeditor/ckeditor5-upload": "^10.0.1", - "babel-minify-webpack-plugin": "^0.3.0", - "postcss-loader": "^2.0.10", + "postcss-loader": "^2.1.5", "raw-loader": "^0.5.1", - "style-loader": "^0.20.3", - "webpack": "^3.11.0", - "webpack-sources": "1.0.1" + "style-loader": "^0.21.0", + "uglifyjs-webpack-plugin": "^1.2.7", + "webpack": "^4.12.2", + "webpack-cli": "^3.0.8" }, "engines": { "node": ">=6.0.0", diff --git a/webpack.config.js b/webpack.config.js index 640716d20c..b44d7c5fb8 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 BabiliPlugin = require( 'babel-minify-webpack-plugin' ); +const UglifyJsWebpackPlugin = require( 'uglifyjs-webpack-plugin' ); const buildConfig = require( './build-config' ); module.exports = { @@ -27,19 +27,29 @@ module.exports = { library: buildConfig.moduleName }, + optimization: { + minimizer: [ + new UglifyJsWebpackPlugin( { + sourceMap: true, + uglifyOptions: { + output: { + // Preserve license comments starting with at least 30 `-` chars. + comments: /^-{30,}/ + } + } + } ) + ] + }, + plugins: [ new CKEditorWebpackPlugin( { language: buildConfig.config.language, additionalLanguages: 'all' } ), - new BabiliPlugin( null, { - comments: false - } ), new webpack.BannerPlugin( { banner: bundler.getLicenseBanner(), raw: true - } ), - new webpack.optimize.ModuleConcatenationPlugin() + } ) ], module: { From 166efaa65488b783f45a919b6623343b62f6da7a Mon Sep 17 00:00:00 2001 From: Maciej Bukowski Date: Tue, 3 Jul 2018 13:38:44 +0200 Subject: [PATCH 2/6] Switched back to banner with exclamation mark. --- webpack.config.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index b44d7c5fb8..5573493ebf 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -29,12 +29,14 @@ module.exports = { optimization: { minimizer: [ + // Use the newest version of UglifyJsWebpackPlugin plugin that fixes `inline` optimization bug. + // See https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/264. new UglifyJsWebpackPlugin( { sourceMap: true, uglifyOptions: { output: { - // Preserve license comments starting with at least 30 `-` chars. - comments: /^-{30,}/ + // Preserve license comments starting with the exclamation mark (!). + comments: /^!/ } } } ) From b1b436f66adc6d8dbbc48f43db424bed6dc9c25a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Thu, 5 Jul 2018 13:46:50 +0200 Subject: [PATCH 3/6] Webpack up. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a28672c7b9..4b3d212292 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "raw-loader": "^0.5.1", "style-loader": "^0.21.0", "uglifyjs-webpack-plugin": "^1.2.7", - "webpack": "^4.12.2", + "webpack": "^4.15.0", "webpack-cli": "^3.0.8" }, "engines": { From abf173fad9f7cdc1938581b806c623ee86a26c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Thu, 5 Jul 2018 14:18:25 +0200 Subject: [PATCH 4/6] Bump, bump. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4b3d212292..296a97f5f8 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ "@ckeditor/ckeditor5-autoformat": "^10.0.1", "@ckeditor/ckeditor5-basic-styles": "^10.0.1", "@ckeditor/ckeditor5-block-quote": "^10.0.1", - "@ckeditor/ckeditor5-dev-utils": "^9.0.0", - "@ckeditor/ckeditor5-dev-webpack-plugin": "^5.0.0", + "@ckeditor/ckeditor5-dev-utils": "^10.0.0", + "@ckeditor/ckeditor5-dev-webpack-plugin": "^6.0.0", "@ckeditor/ckeditor5-easy-image": "^10.0.1", "@ckeditor/ckeditor5-editor-classic": "^10.0.1", "@ckeditor/ckeditor5-essentials": "^10.1.0", From 1225ff11c3183cad3da5a45ebafbac0a8f9cca55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Thu, 5 Jul 2018 15:09:06 +0200 Subject: [PATCH 5/6] Hide unnecessary warnings. --- webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/webpack.config.js b/webpack.config.js index 5573493ebf..ad4dc61914 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -16,6 +16,7 @@ const buildConfig = require( './build-config' ); module.exports = { devtool: 'source-map', + performance: { hints: false }, entry: path.resolve( __dirname, 'src', 'ckeditor.js' ), From 375c47cc054a9214c892b1b3927fe543abb20341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Thu, 5 Jul 2018 15:38:57 +0200 Subject: [PATCH 6/6] Improved comments. --- webpack.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index ad4dc61914..84108480da 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -30,13 +30,13 @@ module.exports = { optimization: { minimizer: [ - // Use the newest version of UglifyJsWebpackPlugin plugin that fixes `inline` optimization bug. + // Use the newest version of UglifyJsWebpackPlugin that fixes the `inline` optimization bug. // See https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/264. new UglifyJsWebpackPlugin( { sourceMap: true, uglifyOptions: { output: { - // Preserve license comments starting with the exclamation mark (!). + // Preserve CKEditor 5 license comments. comments: /^!/ } }