From 338f65117829a7af76ee762c187f49a8a8103236 Mon Sep 17 00:00:00 2001 From: metonym Date: Thu, 8 Aug 2024 12:43:08 -0700 Subject: [PATCH] chore(examples): use `OptimizeCssPlugin` in Webpack set-up --- examples/webpack/webpack.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/webpack/webpack.config.js b/examples/webpack/webpack.config.js index 886c719b..81ae1ba8 100644 --- a/examples/webpack/webpack.config.js +++ b/examples/webpack/webpack.config.js @@ -1,7 +1,10 @@ const HtmlWebpackPlugin = require("html-webpack-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const path = require("path"); -const { optimizeImports } = require("carbon-preprocess-svelte"); +const { + optimizeImports, + OptimizeCssPlugin, +} = require("carbon-preprocess-svelte"); const NODE_ENV = process.env.NODE_ENV || "development"; const PROD = NODE_ENV === "production"; @@ -48,6 +51,7 @@ module.exports = { }, mode: NODE_ENV, plugins: [ + PROD && new OptimizeCssPlugin(), new MiniCssExtractPlugin({ filename: PROD ? "[name].[chunkhash].css" : "[name].css", }),