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

Commit

Permalink
Merge pull request #48 from ckeditor/t/ckeditor5-dev/371
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Reinmar committed Jul 5, 2018
2 parents deb2beb + 375c47c commit 9392b43
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bin/build-ckeditor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo "Building 'build/ckeditor.js'..."
echo ""

webpack
webpack --mode production

echo ""
echo "Done."
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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.15.0",
"webpack-cli": "^3.0.8"
},
"engines": {
"node": ">=6.0.0",
Expand Down
25 changes: 19 additions & 6 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ 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 = {
devtool: 'source-map',
performance: { hints: false },

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

Expand All @@ -27,19 +28,31 @@ module.exports = {
library: buildConfig.moduleName
},

optimization: {
minimizer: [
// 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 CKEditor 5 license comments.
comments: /^!/
}
}
} )
]
},

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: {
Expand Down

0 comments on commit 9392b43

Please sign in to comment.