mirror of
https://github.com/hanzoai/swc.git
synced 2026-10-30 19:42:53 +00:00
**Description:** Summary of Changes: 1. Adds an `outFileExtension` property to every module configuration option struct 2. passes this configuration through to the resolver function and changes all hard-coded `"js"` checks to use the new parameter 3. As a matter of backwards compatibility, structures default to "js" if nothing is provided 4. `@swc/core` snapshot tests for each module using `resolveFully` and `outFileExtension` (Please check the rendered output of the snapshots to make sure you don't have any issues with it). 1. QOL - updates `@swc/core` jest config to use explicit module names (this was because the mapping util in jest was exploding when it would try to load in the .node files that were over 512MB) 5. QOL - updates the test script to pass through any existing NODE_OPTIONS - this allows debugging tools to add their own inspect configurations while preserving our esm module flag **Note** This is a rudimentary fix to: https://github.com/swc-project/swc/issues/3067#issuecomment-2516108434. I had to implement it locally since I could not find a workaround in my timeline. I do know that @kdy1 said they would work on it a few days ago, so I am opening this to either provide some visibility to a solution that works for me if they haven't started or to let them switch to PR critique if that feels more valuable for their time on this issue. Let me know if this should be closed due to a better implementation already being in the works. **Related issue:** - Closes https://github.com/swc-project/swc/issues/3067 --------- Co-authored-by: Donny/강동윤 <[email protected]>