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

[Feature]: Provide options to force use swc and specify swc configuration for modern.js modules #5393

Open
kirainmoe opened this issue Feb 18, 2024 · 1 comment

Comments

@kirainmoe
Copy link
Contributor

What problem does this feature solve?

According to this document, modern.js modules use esbuild as default js/ts transpiler, and will use swc to replace esbuild only in specific scenarios.

I wonder that is there any chance we can make modern.js module force using swc as transpiler by enabling an option, given that esbuild has some limitations, for example it can not preserve comments in bundle output. And it would be better if users can customize swc configuration.

What does the proposed API look like?

Like esbuildOptions, add an option names swc:

swc?: {
    force?: boolean;
    options?: SwcOptions; // follow swc officical schema: https://swc.rs/docs/configuration/compilation
}
@10Derozan
Copy link
Member

Welcome PR

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

No branches or pull requests

3 participants