Skip to content
New issue

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

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

Already on GitHub? # to your account

[@rollup/plugin-swc]: change how default options are resolved #1829

Open
sehnemvinicius opened this issue Dec 18, 2024 · 0 comments
Open

[@rollup/plugin-swc]: change how default options are resolved #1829

sehnemvinicius opened this issue Dec 18, 2024 · 0 comments

Comments

@sehnemvinicius
Copy link

sehnemvinicius commented Dec 18, 2024

  • Rollup Plugin Name: @rollup/plugin-swc
  • Rollup Plugin Version: latest

Expected Behavior / Situation

assume the default option values ​​that swc provides

Actual Behavior / Situation

given this configurarion:

plugins: [
  swc({ swc: {
    jsc: {
      parser: {
        decorators: true,
        syntax: 'typescript',
        tsx: true,
      },
      transform: {
        react: {
          runtime: 'automatic',
        },
      },
    },
    minify: true,
  }}),
]

when i used this swc configuration together with the rollup i noticed some things in my bundle that using the swc cli directly were not happening:
1 - bundle with loose active
2 - decorators with a different spec than the one i need to consume

after merging my configuration with the default ones i end up having these problems, i would like to be using the defaults from the swc itself, considering that the active options here are for "legacy".

are there any reasons why the defaults of this plugin are different from those considered by swc?

Modification Proposal

this plugin is just a plugin that connects swc to rollup, it does not define any property.

if this makes sense, can i open the PR with the changes? should i worry about any specific process?

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

No branches or pull requests

1 participant