You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SWC removes import assertions from esm imports which isn't the expected result, since I am trying to run this file in the browser and it requires import assertions for json imports. I think the import assertions should be kept intact if jsc.parser.importAssertions is set to true and the target supports it
The import assertions should stay intact if the target environment is set to esnext, module system is esm and importAssertions in the config is set to true.
The expected output would be:
importjsonfrom'./file.json'assert{type: "json" }
Version
1.2.107
Additional context
No response
The text was updated successfully, but these errors were encountered:
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
SWC removes import assertions from esm imports which isn't the expected result, since I am trying to run this file in the browser and it requires import assertions for json imports. I think the import assertions should be kept intact if
jsc.parser.importAssertions
is set totrue
and the target supports itInput code
Config
Playground link
https://play.swc.rs/?version=1.2.107&code=H4sIAAAAAAAAA8vMLcgvKlHIKs7PU0grys9VUFDX00%2FLzEnVAwmpKyQWF6cC5asVSioLUq0UlECiSgq1AMdd9yk3AAAA&config=H4sIAAAAAAAAA0WOsQ7DIAxE%2F8UzQ5uhQ7Z%2BQD8CUSeiAoxsRypC%2FHshSprNOt%2B7uwofcTBXyJYFeVxSktovzIAuWnHss4Lpti4tNgga8DET61M6oJ6SwKy8YTOgllfUgcp0m%2B4dC0SCfzD65JcyShzFzChyvWxaw%2BlsPSvSextCBS0Z98wHtCvj3CKvw7hv%2BAFPJhDn0AAAAA%3D%3D
Expected behavior
The import assertions should stay intact if the target environment is set to esnext, module system is esm and
importAssertions
in the config is set totrue
.The expected output would be:
Version
1.2.107
Additional context
No response
The text was updated successfully, but these errors were encountered: