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

Commit

Permalink
Switched to [email protected] and UglifyJsWebpackPlugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
ma2ciek committed Jun 29, 2018
1 parent cbee379 commit d89bcd8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 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."
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
22 changes: 16 additions & 6 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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: {
Expand Down

0 comments on commit d89bcd8

Please sign in to comment.