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

Upgrade webpack to v.4 #48

Merged
merged 7 commits into from
Jul 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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