Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: terser options "manage.keep_fnames" can be RegExp #1917

Closed
linzebingo opened this issue Mar 22, 2024 · 2 comments
Closed

[Bug]: terser options "manage.keep_fnames" can be RegExp #1917

linzebingo opened this issue Mar 22, 2024 · 2 comments
Labels
🐞 bug Something isn't working

Comments

@linzebingo
Copy link

Version

@rsbuild/* 0.5.2

Details

terser options "manage.keep_fnames" can be RegExp

image

link https://terser.org/docs/options/#mangle-options

Reproduce link

N/A

Reproduce Steps

1、create a rsbuild project
2、modify rsbuild.config.ts

    minify: {
      jsOptions: {
        mangle: {
          keep_fnames: /stringify/,
        },
      },
    },

3、got errror
image

@linzebingo linzebingo added the 🐞 bug Something isn't working label Mar 22, 2024
@chenjiahan
Copy link
Member

Rsbuild use SWC to minify the JS code, and SWC does not supports keep_fnames RegExp yet, see:

You can submit an issue to the SWC repo to request this feature 😄

@chenjiahan
Copy link
Member

Also, we plan to support using Terser as the JS minimizer in Rsbuild / Rspack projects, ref: web-infra-dev/rspack#3639

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants