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

@swc/core Even if jsc.preserveAllComments is set, comments are still removed after turning on experimenta. disableBuiltinTransformsForInternalTesting #9850

Open
Yekongs opened this issue Jan 7, 2025 · 0 comments

Comments

@Yekongs
Copy link

Yekongs commented Jan 7, 2025

Describe the bug

@swc/core Even if jsc.preserveAllComments is set, comments are still removed after turning on experimenta. disableBuiltinTransformsForInternalTesting

Input code

<div>
    //ddd
    {/* #if IS_VOLC */}
    {/* #endif */}
    <div>123</div>
</div>

Config

{
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "tsx": true
    },
    "preserveAllComments": true,
    "experimental": {
      "disableBuiltinTransformsForInternalTesting": true
    }
  },
}

Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.10.5-nightly-20250107.1&code=H4sIAAAAAAAAA7NJySyz41IAAn39lJQUMKtaX0tBOTNNwTM4Pszfx1lBS78WIZ6alwKUggnZgLQbGhnb6IPNgVAArdJUC1QAAAA%3D&config=H4sIAAAAAAAAA1WNzQrCQAyE732KZc99Am8qCN77ArFGWcn%2BkKTSUvruTcsqepuZb5iZG%2Bf8S3p%2FcLNJMwVYkL%2FeEpmSwmiJ16mg9ByK%2BvZDVTakPOCeLG2dYbSZNx6JzjlGTCq1Vgs4FuSwAaDft3sQuBGehkAaUseQ5JE5yiXzNSlyAupQDD3%2Fbpv9elkBEFAYXdAAAAA%3D

SWC Info output

No response

Expected behavior

Comments should not be removed

Actual behavior

No response

Version

1.10.4 and 1.10.5-nightly

Additional context

No response

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

No branches or pull requests

2 participants