aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/config
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-10-20 17:42:45 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-10-23 08:57:31 +0200
commit6f91323b77d6c2286a286071179ad63c5fb782fc (patch)
tree0303c63576ac6819e916116c8c5c2426a88acb7b /server/sonar-web/config
parentdc956f504a1f1feb03b6d3650cddae6048a2d41b (diff)
downloadsonarqube-6f91323b77d6c2286a286071179ad63c5fb782fc.tar.gz
sonarqube-6f91323b77d6c2286a286071179ad63c5fb782fc.zip
minimize css
Diffstat (limited to 'server/sonar-web/config')
-rw-r--r--server/sonar-web/config/webpack.config.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/server/sonar-web/config/webpack.config.js b/server/sonar-web/config/webpack.config.js
index c5d08949f53..a9478858b5b 100644
--- a/server/sonar-web/config/webpack.config.js
+++ b/server/sonar-web/config/webpack.config.js
@@ -7,6 +7,10 @@ const eslintFormatter = require('react-dev-utils/eslintFormatter');
const webpack = require('webpack');
const paths = require('./paths');
+const cssMinimizeOptions = {
+ discardComments: { removeAll: true }
+};
+
module.exports = ({ production = true, fast = false }) => ({
bail: production,
@@ -97,7 +101,10 @@ module.exports = ({ production = true, fast = false }) => ({
test: /\.css$/,
use: [
'style-loader',
- 'css-loader',
+ {
+ loader: 'css-loader',
+ options: { minimize: production && !fast && cssMinimizeOptions }
+ },
{
loader: 'postcss-loader',
options: {
@@ -113,7 +120,7 @@ module.exports = ({ production = true, fast = false }) => ({
use: [
{
loader: 'css-loader',
- options: { url: false }
+ options: { url: false, minimize: production && !fast && cssMinimizeOptions }
},
{
loader: 'postcss-loader',