commit abf789500d5ffb5071d6c6c6515b9cc1b6e341d4
parent e0f299bddce3878efdf366db810eb1a140a3e21f
Author: Vladimir Kutepov <frenzzy.man@gmail.com>
Date: Tue, 8 Mar 2016 23:23:02 +0300
Discard comments from CSS in release mode
Diffstat:
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/tools/webpack.config.js b/tools/webpack.config.js
@@ -76,8 +76,17 @@ const config = {
test: /\.scss$/,
loaders: [
'isomorphic-style-loader',
- `css-loader?${DEBUG ? 'sourceMap&' : 'minimize&'}modules&localIdentName=` +
- `${DEBUG ? '[name]_[local]_[hash:base64:3]' : '[hash:base64:4]'}`,
+ `css-loader?${JSON.stringify({
+ sourceMap: DEBUG,
+
+ // CSS Modules https://github.com/css-modules/css-modules
+ modules: true,
+ localIdentName: DEBUG ? '[name]_[local]_[hash:base64:3]' : '[hash:base64:4]',
+
+ // CSS Nano http://cssnano.co/options/
+ minimize: !DEBUG,
+ discardComments: { removeAll: true },
+ })}`,
'postcss-loader?parser=postcss-scss',
],
}, {