-
Notifications
You must be signed in to change notification settings - Fork 59
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
Allow SWC Config Overrides #253
Comments
The reason is that this makes a barrier for people to continue using their tech debt and expect that this will be maintain forever. I love maintaining this plugin, but I don't want to have to deal with issues related to how 3 legacy flags used together create a bug. The SWC team decided they want do to that, but that's not my case. In the same idea, this plugin will not be considered a main plugin when OXC is good enough for replacing the current usages, and I'm think the OXC did choose to not implement the old TS behavior for decorators. I hope think the friction of creating a patch is for me good so that people know they are in a non supported zone, and hopefully this feels hacky enough so people start to look to migrate their lib to spec compliant alternatives or default cross bundler features. |
@ArnaudBarre I appreciate the thoughtful and thorough answer. We'll continue using a patch for now, but look into migrating our decorator usage to use |
I'm working on switching from Webpack to Vite and would love to port over our full SWC config. I'm able to get fairly close simply by providing the
plugins
andtsDecorators
options, but there are a few other options which I can't currently provide:useDefineForClassFields
- This plugin currently sets this totrue
with no way to override. It makes sense as this is more spec compliant, but we have a fair amount of code which breaks if this isn'tfalse
.keepClassNames
- This isn't an immediate problem for us as we are only using Vite for dev builds at the moment, but it would be blocking if we decide to use Vite for prod builds with SWC via this plugin.For context, we need these options because we use Catalyst, which uses a few interesting patterns with decorators and uses class names to implicitly define custom element names.
My general question - is there a reason we can't override the config after the plugin applies all the default settings? e.g. a hook that gives you the config object just before
transform
is called (similar to the more limitedparserConfig
option)? It seems like this would be useful for many use cases, such as #86 where folks currently have to patch the package to get the desired options.The text was updated successfully, but these errors were encountered: