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
dynamicImport
option doesn't work with CJS export TypeScript
#8914
Comments
@aramissennyeydd You can set I'll close this issue with a documentation commit |
Oh it was documented. https://swc.rs/docs/configuration/modules#ignoredynamic |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I'm working to allow Backstage to use ESM modules using dynamic imports as part of our migration path away from CJS, backstage/backstage#22638. We're using Rollup for production builds and SWC locally. I'm unable to get SWC to keep dynamic imports in our output.
Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.4.13&code=H4sIAAAAAAAAA9NILK7MS1bQ0LS1q%2BZSUEjOzysuUShJBRK2ConliZklCpm5BflFJRrqmXnZ6prWKGqMMBTp6YPE9XKzikFqazUBQDmEwl8AAAA%3D&config=H4sIAAAAAAAAA2WPPQ7DMAiF954iYu5QZewNOvQQlkMiR8G2gEi1oty9dn7cVt3gffAeLJemgVEs3Jsll7mJhgW59lmR5NW8sgKaIoplFxWuJ1UpqDeTYNW65A05%2B6AYWDNVnnFj6z4CanjAQgClvbXtYQdTCIK%2FdkDOuz59H2QDRUaRv1wyfpjq%2Fp54OVKBQjdv8Hi0PFMuyG4U%2FCjwmTwTqzs4eZ7r2zPrG1secAA5AQAA
edit: updated to one with
dynamicImport
set - the behavior is the same.SWC Info output
No response
Expected behavior
The import statement is preserved
Actual behavior
Version
@swc/core: 1.4.8
Additional context
No response
The text was updated successfully, but these errors were encountered: