Skip to content

Commit

Permalink
Attempted (and failed) to fix 490
Browse files Browse the repository at this point in the history
I've used the optivmize-css-assets-webpack-plugin as recommended. Comments still appear.
Somebody else reported the same issue in Jan but nobody has responded: :-O
NMFR/optimize-css-assets-webpack-plugin#93
  • Loading branch information
Dave Sirockin committed Aug 22, 2019
1 parent f9fc424 commit 65ce5e8
Show file tree
Hide file tree
Showing 3 changed files with 1,104 additions and 2 deletions.
12 changes: 10 additions & 2 deletions config/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
var webpack = require('webpack');
var webpackMerge = require('webpack-merge');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const TerserJSPlugin = require("terser-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const RemoveStrictPlugin = require('remove-strict-webpack-plugin');
var UnminifiedWebpackPlugin = require('unminified-webpack-plugin');
var commonConfig = require('./webpack.common.js');
Expand Down Expand Up @@ -29,6 +31,13 @@ module.exports = webpackMerge(commonConfig, {

plugins: [
new RemoveStrictPlugin(), // I have put this in to avoid IE throwing error Assignment to read-only properties is not allowed in strict mode
new OptimizeCSSAssetsPlugin({
cssProcessor: require('cssnano'),
cssProcessorPluginOptions: {
preset: ['default', { discardComments: { removeAll: true } }],
},
canPrint: true
}),
new UnminifiedWebpackPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
/*
Expand All @@ -45,7 +54,6 @@ module.exports = webpackMerge(commonConfig, {
chunkFilename: '[id].css',
ignoreOrder: false, // Enable to remove warnings about conflicting order
}),

new webpack.DefinePlugin({
'process.env': {
'ENV': JSON.stringify(ENV)
Expand Down

0 comments on commit 65ce5e8

Please sign in to comment.