1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-14 00:19:16 +01:00

fix(webpack): Strip all comments in css/js bundles.

This commit is contained in:
ivaosthu 2018-08-22 18:06:28 +02:00
parent 60fd204bc2
commit da088113af
4 changed files with 665 additions and 26 deletions

View File

@ -10,8 +10,11 @@ The latest version of this document is always available in
## [Unreleased] ## [Unreleased]
## [3.1.3]
- fix(webpack): Strip all comments in css/js bundles.
## [3.1.2] ## [3.1.2]
- chore(package): update webpack to version 4.17.1 ivaosthu 22.08.18 17:04 - chore(package): update webpack to version 4.17.1
- chore(package): move all dependencies to devDependencies as they are not used outside this module. - chore(package): move all dependencies to devDependencies as they are not used outside this module.
## [3.1.1] ## [3.1.1]

View File

@ -65,6 +65,7 @@
"mini-css-extract-plugin": "^0.4.1", "mini-css-extract-plugin": "^0.4.1",
"node-sass": "^4.5.3", "node-sass": "^4.5.3",
"normalize.css": "^8.0.0", "normalize.css": "^8.0.0",
"optimize-css-assets-webpack-plugin": "^5.0.0",
"prettier": "^1.8.2", "prettier": "^1.8.2",
"prop-types": "^15.6.2", "prop-types": "^15.6.2",
"react": "^16.4.2", "react": "^16.4.2",
@ -83,6 +84,7 @@
"sass-loader": "^7.0.1", "sass-loader": "^7.0.1",
"style-loader": "^0.22.0", "style-loader": "^0.22.0",
"toolbox-loader": "0.0.3", "toolbox-loader": "0.0.3",
"uglifyjs-webpack-plugin": "^1.3.0",
"webpack": "^4.17.1", "webpack": "^4.17.1",
"webpack-cli": "^3.1.0", "webpack-cli": "^3.1.0",
"webpack-dev-server": "^3.1.5", "webpack-dev-server": "^3.1.5",

View File

@ -4,6 +4,8 @@
const path = require('path'); const path = require('path');
const webpack = require('webpack'); const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const devMode = process.env.NODE_ENV !== 'production'; const devMode = process.env.NODE_ENV !== 'production';
const mode = process.env.NODE_ENV === 'production' ? 'production' : 'development'; const mode = process.env.NODE_ENV === 'production' ? 'production' : 'development';
const entry = ['whatwg-fetch', './src/index']; const entry = ['whatwg-fetch', './src/index'];
@ -41,6 +43,23 @@ module.exports = {
publicPath: '/static/', publicPath: '/static/',
}, },
optimization: {
minimizer: [
new UglifyJsPlugin({
uglifyOptions: {
output: {
comments: false
},
},
}),
new OptimizeCssAssetsPlugin({
cssProcessor: require('cssnano'),
cssProcessorOptions: { discardComments: { removeAll: true } },
canPrint: true,
}),
],
},
module: { module: {
rules: [ rules: [
{ {

File diff suppressed because it is too large Load Diff