1237 releases (269 breaking)
|new 0.269.79||Dec 3, 2023|
|0.269.75||Nov 29, 2023|
|0.264.33||Jul 31, 2023|
|0.258.7||Mar 31, 2023|
|0.13.0||Mar 31, 2021|
#2632 in Web programming
24,490 downloads per month
Used in 24 crates (17 directly)
All files named
exec.ts will be executed, and the test system will ensure that original source code and transpiled source code print the same output to the console.
You can use
./scripts/check-issues.sh to automatically unignore fixed tests.
The main crate of the swc project.
This is documentation for building custom build tools on top of swc.
Dependency version management
swc has swc_css, which re-exports required modules.
See [testing] and swc_ecma_transforms_testing.
What is JsWord?
It's basically an interned string. See [swc_atoms].
Choosing between JsWord vs String
You should prefer JsWord over [String] if it's going to be stored in an AST node.
See [swc_atoms] for detailed description.
Fold vs VisitMut vs Visit
See [swc_visit] for detailed description.
Variable management (Scoping)
How identifiers work
See the doc on swc_ecma_ast::Ident or on swc_ecma_transforms_base::resolver::resolver_with_mark.
Comparing two identifiers
Creating a unique identifier
These methods are aware of the fact that
"use strict" directive should be
first in a file, and insert statements after directives.
Each stuffs are documented at itself.
Reducing binary size
The visitor expands to a lot of code. You can reduce it by using macros like
Note that this will make typescript-related nodes not processed, but it's
typically fine as
typescript::strip is invoked at the start and it removes
expr.evaluate() of babel