Skip to content

Commit

Permalink
fix(bundler-webpack): keep the default minimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed May 20, 2024
1 parent 1b665a2 commit e08e81f
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions packages/bundler-webpack/src/build/createClientConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,18 @@ export const createClientConfig = async (
// enable runtimeChunk
config.optimization.runtimeChunk(true)

// minify css
config.optimization
.minimizer('css-minimizer-webpack-plugin')
.use(CssMinimizerPlugin, [
{
minify:
CssMinimizerPlugin.lightningCssMinify as CssMinimizerPlugin.BasicMinimizerImplementation<unknown>,
},
])
// minimize
config.optimization.minimize(true)

// minimizer
config.optimization.set('minimizer', [
// keep the default minimizer
'...',
// add css minimizer
new CssMinimizerPlugin({
minify: CssMinimizerPlugin.lightningCssMinify,
}),
])

// disable performance hints
if (!app.env.isDebug) {
Expand Down

0 comments on commit e08e81f

Please sign in to comment.