Skip to content

Commit

Permalink
Add forgotten block to Replace OptimizeCssAssetsWebpackPlugin with Cs…
Browse files Browse the repository at this point in the history
…sMinimizerWebpackPlugin
  • Loading branch information
mbarrien committed Feb 10, 2021
1 parent b2002d3 commit 10da47d
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions src/ts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ const CaseSensitivePathsPlugin = require("case-sensitive-paths-webpack-plugin");
const InlineChunkHtmlPlugin = require("react-dev-utils/InlineChunkHtmlPlugin");
const TerserPlugin = require("terser-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const safePostCssParser = require("postcss-safe-parser");
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const { WebpackManifestPlugin } = require("webpack-manifest-plugin");
const InterpolateHtmlPlugin = require("react-dev-utils/InterpolateHtmlPlugin");
const WorkboxWebpackPlugin = require("workbox-webpack-plugin");
Expand Down Expand Up @@ -235,21 +234,18 @@ module.exports = function (webpackEnv) {
},
}),
// This is only used in production mode
new OptimizeCSSAssetsPlugin({
cssProcessorOptions: {
parser: safePostCssParser,
map: shouldUseSourceMap
? {
// `inline: false` forces the sourcemap to be output into a
// separate file
inline: false,
// `annotation: true` appends the sourceMappingURL to the end of
// the css file, helping the browser find the sourcemap
annotation: true,
}
: false,
},
cssProcessorPluginOptions: {
new CssMinimizerPlugin({
sourceMap: shouldUseSourceMap
? {
// `inline: false` forces the sourcemap to be output into a
// separate file
inline: false,
// `annotation: true` appends the sourceMappingURL to the end of
// the css file, helping the browser find the sourcemap
annotation: true,
}
: false,
minimizerOptions: {
preset: ["default", { minifyFontValues: { removeQuotes: false } }],
},
}),
Expand Down

0 comments on commit 10da47d

Please sign in to comment.