mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 09:51:36 +00:00
chore(examples): use OptimizeCssPlugin
in Webpack set-up
This commit is contained in:
parent
5fb86e1ac6
commit
338f651178
1 changed files with 5 additions and 1 deletions
|
@ -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",
|
||||
}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue