-
-
Notifications
You must be signed in to change notification settings - Fork 32
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 Request] Add SWC as a transpiler #155
Comments
Hey there. The thing that is holding me back is that given What I really want to do is to declare I guess this would have to require an update to the major SemVer version in that it will require package consumers to add the babel dependencies to their own package.json files, which may start breaking on CI. I'll mark this as a feature request, but it is in line with what I've wanted to do here anyway for quite some time. |
Hey there. This has been implemented as part of v2.0.0! |
Thanks! I'm trying out 2.0.4 right now, and I'm running into this error:
I'm defining a swcConfig like this at the top of my file: const swcConfig = {
jsc: {
parser: {
syntax: 'typescript',
tsx: true
},
target: 'es2018'
}
} And then doing this in my plugins: isProd
? ts({
transpiler: 'swc',
swcConfig,
hook: {
// Always rename declaration files to index.d.ts to avoid emitting two declaration files with identical contents
outputPath: (path, kind) => kind === 'declaration' ? './index.d.ts' : path
}
})
: swc(swcConfig) Note that when I run a "dev" build, it runs Rollup through the |
First, the target you provide in your swc config is not actually respected. If The stack trace from Swc still does have a lot of of bugs like this. I'll work around it by not generating a browserslist based on the target ecma version if no browserslist was found and swc is used. I'll track it in a separate issue: #163 |
@wessberg Thanks for looking into it! |
Feature Use Case
It would be nice to be able to generate
.d.ts
files, and useswc
for syntax transforms a la https://swc.rs/. SWC is about 10x faster than Babel.Feature Proposal
Add
swc
to the list oftranspiler
options, and run syntax transforms through it, similar to https://www.npmjs.com/package/rollup-plugin-swcThe text was updated successfully, but these errors were encountered: