modern.js
modern.js copied to clipboard
[Feature]: Provide options to force use swc and specify swc configuration for modern.js modules
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
}
Welcome PR