From: Stas Vilchik Date: Fri, 20 Oct 2017 15:42:45 +0000 (+0200) Subject: minimize css X-Git-Tag: 6.7-RC1~121 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6f91323b77d6c2286a286071179ad63c5fb782fc;p=sonarqube.git minimize css --- 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',