const webpack = require('webpack');
const paths = require('./paths');
+const cssMinimizeOptions = {
+ discardComments: { removeAll: true }
+};
+
module.exports = ({ production = true, fast = false }) => ({
bail: production,
test: /\.css$/,
use: [
'style-loader',
- 'css-loader',
+ {
+ loader: 'css-loader',
+ options: { minimize: production && !fast && cssMinimizeOptions }
+ },
{
loader: 'postcss-loader',
options: {
use: [
{
loader: 'css-loader',
- options: { url: false }
+ options: { url: false, minimize: production && !fast && cssMinimizeOptions }
},
{
loader: 'postcss-loader',