mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-29 07:04:09 +08:00
A loader `L = () => M ??= NS` over a lazily initialized module's namespace (optionally through __toESM) is respelled at every `L().name` as the module's initializer call followed by the export's live read; loaders whose result escapes as a value stay refused. The canonical export table keeps a getter it cannot chase as a live accessor, so a lazy re-export still initializes its module at the first read. An ES-module importer copies those accessors once when it links the CommonJS module, in the lexer's order, exactly like Node's loader; require() keeps reading them live. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 lines
326 B
JSON
8 lines
326 B
JSON
{
|
|
"name": "gtlazy",
|
|
"version": "1.0.0",
|
|
"description": "esbuild 0.25.10 output (--bundle --platform=node --format=cjs) of a barrel whose re-exports a build plugin turns into memoized lazy loaders: `load_x = () => x ??= (init_x(), __toCommonJS(x_exports))`",
|
|
"main": "./dist/index.js",
|
|
"types": "./dist/index.d.ts"
|
|
}
|