-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: re-transpile excluded modules when target is es5 #1
Conversation
Just set It is designed to let |
Hi @SukkaW. This did not work for me. The |
@SukkaW I think I got closer to the issue. It seems that swc does not like the |
@klipstein I might have an idea. Would you mind try this one out:
import { nodeResolve } from '@rollup/plugin-node-resolve';
// ...
plugin: [
nodeResolve(),
// Your other plugins, like swc
] Then test if Detailed explanation: I have searched If your test with |
My rollup setup is as such:
When I replace
|
Maybe this also helps further: https://rollupjs.org/guide/en/#conventions There it says:
|
Thanks for improving the two initial versions of the rollup-plugin-swc.
I wanted to use it in a project where I partially have to transpile to ES5 (to still support IE11) and this particular project uses quite some CommonJS node dependencies which get processed via
@rollup/plugin-commonjs
.The rollup-plugin commonjs then partially generates "proxy" dependencies (which look similar to this) which need to be excluded from the initial
transform(code, id)
, because swc cannot resolve those proxy dependencies and the build would then fail with errors like this:When those node module dependencies are excluded from swc this error disappears but then those external dependencies (which mostly are ES6 = ES2015) won't be transpiled to ES5.
It probably is an edge case, but it would be great if you include it in version 3 of rollup-plugin-swc so that I can avoid creating
rollup-plugin-swc4
:)