swc-project
swc
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
feat(es/module): support moduleRoot for AMD module IDs (#11964) Closes #4014 ### Description This PR adds support for the moduleRoot configuration property in the AMD module transformer. When you specify a moduleRoot, SWC will now compute the module ID based on the relative path between that root directory and the file currently being compiled. The goal here is to make SWC perfectly mimic TypeScript's AMD path generation behavior! I've also made sure we handle edge cases correctly: - **Config Resolution:** If moduleRoot is defined in a .swcrc file, we now correctly resolve it relative to the directory where the .swcrc file lives, rather than just blindly using the process cwd. - **Programmatic Options:** Programmatic options are natively respected without incorrectly rebasing them against the file path. - **Symlinks:** The logic respects jsc.preserveSymlinks = true. I added a component-count heuristic so we safely fall back to filesystem canonicalization *only* when absolutely necessary (like when dealing with Windows \?\ verbatim paths). - **Typings:** I've updated the WASM typings to make sure the new moduleRoot bindings are exposed consistently across both the core and minifier declarations. ### BREAKING CHANGE: None. ### Related issue: #4014 --------- Co-authored-by: Donny/강동윤 <kdy.1997.dev@gmail.com>
main
3 minutes ago
mod(es/minifier): Check Map/Set param is array (#12287)
main
4 minutes ago
fix(es/codegen): minify unicode escapes in template literals (#12284) **Description:** Minify \uXXXX and \u{...} escapes in untagged template literals, including surrogate pairs. Previously, these escapes were preserved, producing unnecessarily large output. // Before `\u8BF7\u6C42${value}\u{5931}\u8D25 \uD83D\uDE00 \u{1F680}` // After `请求${value}失败 😀 🚀` - Decode from raw without relying on cooked, preserving the codegen API contract. - Handle escaped delimiters, ${, and null characters followed by digits safely; preserve tagged templates, lone surrogates, and ascii_only behavior. - Correct source mappings for decoded newlines and add execution-based regression fixtures. The basic fixture’s minified output shrinks from 114 to 87 UTF-8 bytes.
main
6 minutes ago
fix(es/module): update AMD transform integration
Kaus1ubh:fix-4014-fresh
37 minutes ago
chore: Add changeset
Austaras:iter
41 minutes ago
chore: Add changeset
SyMind:fix-template-unicode-escapes
41 minutes ago
fix(es/minifier): preserve dynamic addition coercion
fix/minifier-constant-join-3
43 minutes ago
fix(es/parser): reject unicode escapes in RegExp flags (#12093) **Description:** ECMA-262 requires a Syntax Error when IdentifierPart in RegExp flags contains a Unicode escape sequence. SWC's lexer had an explicit TODO for this and discarded the `has_escape` flag from `read_word_as_str_with`, so inputs like `/a/g\u0069` parsed successfully even though engines reject them. This change: - emits `UnicodeEscapeInRegExpFlags` when flags contain `\u` / `\u{...}` escapes - allows flags that start with `\` so fully-escaped flags such as `/\u0067` are scanned and rejected correctly Verified against Node and with fixtures under `tests/errors/regexp-flags-unicode-escape/**`.
main
1 hour ago
Latest Branches
CodSpeed Performance Gauge
0%
feat(es/module): support moduleRoot for AMD module IDs
#11964
43 minutes ago
45b9c60
Kaus1ubh:fix-4014-fresh
CodSpeed Performance Gauge
0%
mod(es/minifier): Check Map/Set param is array
#12287
44 minutes ago
8bcff0b
Austaras:iter
CodSpeed Performance Gauge
0%
fix(es/codegen): minify unicode escapes in template literals
#12284
44 minutes ago
7b6bcf7
SyMind:fix-template-unicode-escapes
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs