Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit 9392b43

Browse files
authored
Merge pull request #48 from ckeditor/t/ckeditor5-dev/371
Other: Upgraded `webpack` to version 4. BREAKING CHANGE: CKEditor 5 environment was updated to use `webpack@4`. `webpack@4` introduced major changes in its configuration and plugin system. CKEditor 5 tools and build configuration were updated to work with `webpack@4` now and will not work with `webpack@3.
2 parents deb2beb + 375c47c commit 9392b43

File tree

3 files changed

+27
-14
lines changed

3 files changed

+27
-14
lines changed

bin/build-ckeditor.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
echo "Building 'build/ckeditor.js'..."
44
echo ""
55

6-
webpack
6+
webpack --mode production
77

88
echo ""
99
echo "Done."

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"@ckeditor/ckeditor5-autoformat": "^10.0.1",
3434
"@ckeditor/ckeditor5-basic-styles": "^10.0.1",
3535
"@ckeditor/ckeditor5-block-quote": "^10.0.1",
36-
"@ckeditor/ckeditor5-dev-utils": "^9.0.0",
37-
"@ckeditor/ckeditor5-dev-webpack-plugin": "^5.0.0",
36+
"@ckeditor/ckeditor5-dev-utils": "^10.0.0",
37+
"@ckeditor/ckeditor5-dev-webpack-plugin": "^6.0.0",
3838
"@ckeditor/ckeditor5-easy-image": "^10.0.1",
3939
"@ckeditor/ckeditor5-editor-classic": "^10.0.1",
4040
"@ckeditor/ckeditor5-essentials": "^10.1.0",
@@ -45,12 +45,12 @@
4545
"@ckeditor/ckeditor5-paragraph": "^10.0.1",
4646
"@ckeditor/ckeditor5-theme-lark": "^10.1.0",
4747
"@ckeditor/ckeditor5-upload": "^10.0.1",
48-
"babel-minify-webpack-plugin": "^0.3.0",
49-
"postcss-loader": "^2.0.10",
48+
"postcss-loader": "^2.1.5",
5049
"raw-loader": "^0.5.1",
51-
"style-loader": "^0.20.3",
52-
"webpack": "^3.11.0",
53-
"webpack-sources": "1.0.1"
50+
"style-loader": "^0.21.0",
51+
"uglifyjs-webpack-plugin": "^1.2.7",
52+
"webpack": "^4.15.0",
53+
"webpack-cli": "^3.0.8"
5454
},
5555
"engines": {
5656
"node": ">=6.0.0",

webpack.config.js

+19-6
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ const path = require( 'path' );
1111
const webpack = require( 'webpack' );
1212
const { bundler, styles } = require( '@ckeditor/ckeditor5-dev-utils' );
1313
const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' );
14-
const BabiliPlugin = require( 'babel-minify-webpack-plugin' );
14+
const UglifyJsWebpackPlugin = require( 'uglifyjs-webpack-plugin' );
1515
const buildConfig = require( './build-config' );
1616

1717
module.exports = {
1818
devtool: 'source-map',
19+
performance: { hints: false },
1920

2021
entry: path.resolve( __dirname, 'src', 'ckeditor.js' ),
2122

@@ -27,19 +28,31 @@ module.exports = {
2728
library: buildConfig.moduleName
2829
},
2930

31+
optimization: {
32+
minimizer: [
33+
// Use the newest version of UglifyJsWebpackPlugin that fixes the `inline` optimization bug.
34+
// See https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/264.
35+
new UglifyJsWebpackPlugin( {
36+
sourceMap: true,
37+
uglifyOptions: {
38+
output: {
39+
// Preserve CKEditor 5 license comments.
40+
comments: /^!/
41+
}
42+
}
43+
} )
44+
]
45+
},
46+
3047
plugins: [
3148
new CKEditorWebpackPlugin( {
3249
language: buildConfig.config.language,
3350
additionalLanguages: 'all'
3451
} ),
35-
new BabiliPlugin( null, {
36-
comments: false
37-
} ),
3852
new webpack.BannerPlugin( {
3953
banner: bundler.getLicenseBanner(),
4054
raw: true
41-
} ),
42-
new webpack.optimize.ModuleConcatenationPlugin()
55+
} )
4356
],
4457

4558
module: {

0 commit comments

Comments
 (0)