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]: Class name is removed after bump to Rslib 0.3.0 #652

Closed
chenjiahan opened this issue Jan 6, 2025 · 3 comments
Closed

[Bug]: Class name is removed after bump to Rslib 0.3.0 #652

chenjiahan opened this issue Jan 6, 2025 · 3 comments

Comments

@chenjiahan
Copy link
Member

Version

Rslib 0.3.0

Details

  • source code:

Image

  • output code (Rslib 0.2.x):

Image

  • output code (Rslib 0.3.0):
Image

Reproduce link

web-infra-dev/rsbuild#4333

Reproduce Steps

  1. cd packages/core
  2. pnpm run build
@fi3ework
Copy link
Member

fi3ework commented Jan 6, 2025

Due to we already set passes: 2 in latest Rspack version (SWC reproduction).

I think the behavior is correct, do we considering enable https://swc.rs/docs/configuration/compilation#jsckeepclassnames or update the snapshot 🤔?

@chenjiahan
Copy link
Member Author

I prefer to keep the class name of Rspack plugins, as some users may use "plugin.constructor.name" to determine a plugin.

I will try the option today.

@chenjiahan
Copy link
Member Author

I just find that Terser mangles class names by default, so using "someClass.constructor.name" is unsafe, I will avoid using it.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants