Skip to content

Commit

Permalink
refactor: try @rspack/plugin-minify
Browse files Browse the repository at this point in the history
  • Loading branch information
edbzn committed May 2, 2024
1 parent 8c42f90 commit c4573d4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@nx/workspace": "18.3.4",
"@rspack/cli": "^0.6.3",
"@rspack/core": "^0.6.3",
"@rspack/plugin-minify": "^0.6.3",
"@schematics/angular": "~17.3.0",
"@swc-node/register": "~1.8.0",
"@swc/core": "~1.3.85",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions rspack.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const { composePlugins, withNx, withWeb } = require('@nx/rspack');
const {
HtmlRspackPlugin,
SwcJsMinimizerRspackPlugin,
CopyRspackPlugin,
} = require('@rspack/core');
const minifyPlugin = require('@rspack/plugin-minify');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const lightningcss = require('lightningcss');
const browserslist = require('browserslist');
Expand Down Expand Up @@ -126,7 +126,9 @@ module.exports = composePlugins(withNx(), withWeb(), (baseConfig, ctx) => {
optimization: {
minimize: true,
minimizer: [
new SwcJsMinimizerRspackPlugin(),
new minifyPlugin({
minifier: 'terser',
}),
new CssMinimizerPlugin({
minify: CssMinimizerPlugin.lightningCssMinify,
minimizerOptions: {
Expand Down

0 comments on commit c4573d4

Please sign in to comment.