Skip to content

Commit 48c2dcf

Browse files
authored
fix: disable compress in swc minify (#59)
### Developer Checklist (Definition of Done) **Issue** - [x] All acceptance criteria from the issue are met - [x] Tested in latest Chrome/Firefox **UI/UX/Vis** - [ ] Requires UI/UX/Vis review - [ ] Reviewer(s) are notified (_tag assignees_) - [ ] Review has occurred (_link to notes_) - [ ] Feedback is included in this PR - [ ] Reviewer(s) approve of concept and design **Code** - [x] Branch is up-to-date with the branch to be merged with, i.e., develop - [x] Code is cleaned up and formatted - [ ] Unit tests are written (frontend/backend if applicable) - [ ] Integration tests are written (if applicable) **PR** - [x] Descriptive title for this pull request is provided (will be used for release notes later) - [x] Reviewer and assignees are defined - [x] Add type label (e.g., *bug*, *feature*) to this pull request - [x] Add release label (e.g., `release: minor`) to this PR following [semver](https://semver.org/) - [ ] The PR is connected to the corresponding issue (via `Closes #...`) - [ ] [Summary of changes](#summary-of-changes) is written ### Summary of changes - The compress function has some bugs (w/ arquero for example). See comment in PR for details. ### Screenshots ### Additional notes for the reviewer(s) - Thanks for creating this pull request 🤗
2 parents bf96960 + 9884174 commit 48c2dcf

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

config/rspack.config.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
77
const dotenv = require('dotenv');
88
const { DotenvPlugin } = require('rspack-plugin-dotenv');
99
const dotenvExpand = require('dotenv-expand');
10-
const { CopyRspackPlugin, DefinePlugin } = require('@rspack/core');
10+
const {
11+
CopyRspackPlugin, DefinePlugin, SwcJsMinimizerRspackPlugin, SwcCssMinimizerRspackPlugin,
12+
} = require('@rspack/core');
1113
const ReactRefreshPlugin = require('@rspack/plugin-react-refresh');
1214
const HtmlWebpackPlugin = require('html-webpack-plugin');
1315
const { RsdoctorRspackPlugin } = require('@rsdoctor/rspack-plugin');
@@ -185,6 +187,16 @@ module.exports = (webpackEnv, argv) => {
185187
fs: false,
186188
},
187189
},
190+
optimization: {
191+
minimizer: [
192+
// Disable compress as it has some bugs, i.e. when using arquero#from it fails if no names are passed.
193+
// See https://github.com/web-infra-dev/rspack/issues/4980 for a discussion.
194+
new SwcJsMinimizerRspackPlugin({
195+
compress: false,
196+
}),
197+
new SwcCssMinimizerRspackPlugin(),
198+
],
199+
},
188200
module: {
189201
rules: [
190202
{

0 commit comments

Comments
 (0)