Highlights π‘
Support import.meta.main
import.meta.main is a boolean flag used in ES modules to determine whether the current module is the programβs entry module. It evaluates to true when the module is executed as the main entry, and to false when it is imported by another module. You can think of it as the ESM equivalent of require.main === module in CommonJS. It is useful for running startup logic, initialization code, or CLI behavior only when a module is launched directly.
What's Changed
Performance Improvements β‘
- perf(core): reduce target resolution overhead by @LingyuCoder in #13513
New Features π
- feat: support
import.meta.mainby @ahabhgk in #13489 - feat: support expression in
import.meta.resolveargument by @ahabhgk in #13523 - feat: add ModuleGraph.getUsedExports to ModuleGraph by @SyMind in #13519
Bug Fixes π
- fix(watcher): rename typo
recursiron_directoriestorecurse_parent_directoriesby @jaehafe in #13510 - fix: avoid spreading huge dependency iterables by @SyMind in #13517
- fix(types): allow partial jsc.parser config when detectSyntax is auto by @chenjiahan in #13531
- fix(swc-loader): fallback detectSyntax auto for virtual modules by @chenjiahan in #13529
- fix: reset chunk.rendered in incremental build by @hardfist in #13544
Refactor π¨
- refactor(split-chunks): optimize get_combs lookups by @LingyuCoder in #13532
Document Updates π
- docs(migration): simplify v2 experimental changes by @LingyuCoder in #13479
Other Changes
- chore: update cargo shear and fix issues by @chenjiahan in #13503
- test(benchmark): add codspeed cases for compilation stages by @LingyuCoder in #13499
- chore: try namespace runner for wasm test by @hardfist in #13500
- release: 2.0.0-beta.9 by @chenjiahan in #13502
- chore(ci): move renovate schedule to saturday by @chenjiahan in #13512
- chore: bump emnapi from 1.8.1 to 1.9.1 by @CPunisher in #13516
- test(benchmark): add split chunks codspeed case by @LingyuCoder in #13520
- chore(deps): bump @rslib/core to 0.20.2 by @Timeless0911 in #13525
- chore: split wasm browser ci by @CPunisher in #13504
- chore: adds
-Zfmt-debug=nonefor non-browser wasm target by @CPunisher in #13527 - chore: remove
-Zfmt-debug=noneby @CPunisher in #13540 - chore:
useNapiCrossfor x64 linux gnu compilation by @CPunisher in #13539 - chore(crates): use OIDC to publish crates by @stormslowly in #13543
New Contributors
Full Changelog: v2.0.0-beta.9...v2.0.0-rc.0