@voidzero-dev/vite-plus-core 1.0.0-rc.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE +29 -176
  2. package/dist/rolldown/cli.mjs +9 -8
  3. package/dist/rolldown/config.d.mts +1 -1
  4. package/dist/rolldown/config.mjs +2 -2
  5. package/dist/rolldown/experimental-index.d.mts +4 -4
  6. package/dist/rolldown/experimental-index.mjs +8 -8
  7. package/dist/rolldown/experimental-runtime-types.d.ts +25 -6
  8. package/dist/rolldown/experimental-runtime.d.ts +25 -6
  9. package/dist/rolldown/experimental-runtime.mjs +267 -255
  10. package/dist/rolldown/filter-index.d.mts +1 -1
  11. package/dist/rolldown/index.d.mts +3 -3
  12. package/dist/rolldown/index.mjs +4 -4
  13. package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
  14. package/dist/rolldown/parallel-plugin.d.mts +1 -1
  15. package/dist/rolldown/parse-ast-index.d.mts +1 -1
  16. package/dist/rolldown/parse-ast-index.mjs +1 -1
  17. package/dist/rolldown/plugins-index.d.mts +3 -3
  18. package/dist/rolldown/plugins-index.mjs +2 -2
  19. package/dist/rolldown/shared/{binding-BY0qR5iS.mjs → binding-B4m_2rFW.mjs} +27 -28
  20. package/dist/rolldown/shared/{binding-BTa6BPQe.d.mts → binding-tzp6Hc_3.d.mts} +1 -1
  21. package/dist/rolldown/shared/{bindingify-input-options-B8JHmN6_.mjs → bindingify-input-options-YtcpaV3r.mjs} +196 -13
  22. package/dist/rolldown/shared/{constructors-DuOq7MqW.d.mts → constructors-CGQ9ItSV.d.mts} +2 -2
  23. package/dist/rolldown/shared/{constructors-xEvVj3lN.mjs → constructors-DDRbtWM1.mjs} +1 -1
  24. package/dist/rolldown/shared/{create-bundler-option-COco-7P6.mjs → create-bundler-option-CFtx335R.mjs} +17 -8
  25. package/dist/rolldown/shared/{define-config-C7HCoqY8.d.mts → define-config-kIZKjX8Q.d.mts} +72 -2
  26. package/dist/rolldown/shared/{error-C7pxws0W.mjs → error-Bj1xBdEY.mjs} +2 -1
  27. package/dist/rolldown/shared/{load-config-DkUBnDsI.mjs → load-config-CiFPv7UH.mjs} +2 -2
  28. package/dist/rolldown/shared/{normalize-string-or-regex-F14uvr6D.mjs → normalize-string-or-regex-xyy0kCQR.mjs} +1 -1
  29. package/dist/rolldown/shared/{parse-BWeE7Vr9.mjs → parse-Zii6QoPp.mjs} +2 -2
  30. package/dist/rolldown/shared/{resolve-tsconfig-DHwpIs5e.mjs → resolve-tsconfig-DRWFAQ3v.mjs} +2 -2
  31. package/dist/rolldown/shared/{rolldown-Bue0gNT5.mjs → rolldown-BCQsxZbq.mjs} +4 -4
  32. package/dist/rolldown/shared/{transform-DK_nCt9j.d.mts → transform-D4RDjIPI.d.mts} +1 -1
  33. package/dist/rolldown/shared/{watch-RXhXN1aG.mjs → watch-CXhrnblH.mjs} +4 -4
  34. package/dist/rolldown/utils-index.d.mts +3 -3
  35. package/dist/rolldown/utils-index.mjs +5 -5
  36. package/dist/tsdown/{build-JVmLFaZt-DRlLhpV3.js → build-JVmLFaZt-k6Y-YuG9.js} +8 -8
  37. package/dist/tsdown/{debug-CpC4hV25-C-OYr2iI.js → debug-CpC4hV25-D_60QWpz.js} +2 -2
  38. package/dist/tsdown/{detect-Bg-d8iUV-Du8LljhG.js → detect-Bg-d8iUV--_V5C4Db.js} +1 -1
  39. package/dist/tsdown/{dist-VDcV1Qyy.js → dist-DquISSoY.js} +8 -8
  40. package/dist/tsdown/index-types.d.ts +5 -5
  41. package/dist/tsdown/index.js +4 -4
  42. package/dist/tsdown/{require-BbBF8Ii0-BDaWJgzA.js → require-BbBF8Ii0-S6Y65RhW.js} +1 -1
  43. package/dist/tsdown/{resolver-DE0_sy8o-Bi3xbRxi.js → resolver-DE0_sy8o-Pz8aksn9.js} +2 -2
  44. package/dist/tsdown/run.js +3 -3
  45. package/dist/tsdown/{target-DgdLrXba-DpO9JXxB.js → target-DgdLrXba-BygiKCU8.js} +3 -3
  46. package/dist/tsdown/{tsc-BLb4pSBY.js → tsc-2xhsE0Bf.js} +4 -4
  47. package/dist/tsdown/tsdown-css.js +1 -1
  48. package/dist/tsdown/tsdown-exe.js +3 -3
  49. package/dist/tsdown/{version-CQ98ZBpL-D6GAHapk.js → version-CQ98ZBpL-CKvh-HCu.js} +1 -1
  50. package/dist/vite/client/bundledDevClient.mjs +75 -329
  51. package/dist/vite/client/client.mjs +74 -23
  52. package/dist/vite/node/chunks/node.js +883 -666
  53. package/dist/vite/node/index.d.ts +3 -1
  54. package/dist/vite/node/module-runner.js +16 -2
  55. package/package.json +38 -21
  56. package/dist/rolldown/experimental-default-runtime.mjs +0 -116
  57. package/dist/rolldown/experimental-runtime-base.mjs +0 -95
@@ -1,256 +1,268 @@
1
- import { __exportAll, __reExport, __toCommonJS, __toESM } from './experimental-runtime-base.mjs';
2
- // @ts-check
3
-
4
- class Module {
5
- /**
6
- * @type {{ exports: any }}
7
- */
8
- exportsHolder = { exports: null };
9
- /**
10
- * @type {string}
11
- */
12
- id;
13
-
14
- /**
15
- * @param {string} id
16
- */
17
- constructor(id) {
18
- this.id = id;
19
- }
20
-
21
- get exports() {
22
- return this.exportsHolder.exports;
23
- }
24
- }
25
-
1
+ //#region ../../crates/rolldown/src/runtime/runtime-base.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __exportAll = (all, no_symbols) => {
9
+ let target = {};
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
15
+ return target;
16
+ };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
19
+ key = keys[i];
20
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
21
+ get: ((k) => from[k]).bind(null, key),
22
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
23
+ });
24
+ }
25
+ return to;
26
+ };
27
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
29
+ value: mod,
30
+ enumerable: true
31
+ }) : target, mod));
32
+ var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+ //#endregion
34
+ //#region ../../crates/rolldown_plugin_hmr/src/runtime/runtime-extra-dev-common.js
35
+ var Module = class {
36
+ /**
37
+ * @type {{ exports: any }}
38
+ */
39
+ exportsHolder = { exports: null };
40
+ /**
41
+ * @type {string}
42
+ */
43
+ id;
44
+ /**
45
+ * @param {string} id
46
+ */
47
+ constructor(id) {
48
+ this.id = id;
49
+ }
50
+ get exports() {
51
+ return this.exportsHolder.exports;
52
+ }
53
+ };
26
54
  /**
27
- * Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
28
- * `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
29
- * `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
30
- * @typedef {{ ids: string[], localCount: number, edges: number[][], dynamicEdges?: number[][] }} ModuleGraphDelta
31
- * @typedef {{ createModuleHotContext(moduleId: string): any, onModuleCacheRemoval(moduleId: string): void }} DevRuntimeHooks
32
- */
33
-
34
- export class MissingFactoryError extends Error {
35
- /**
36
- * @param {string} id
37
- */
38
- constructor(id) {
39
- super(`No factory registered for module ${id}`);
40
- this.id = id;
41
- }
42
- }
43
-
44
- export class DevRuntime {
45
- /**
46
- * Client ID generated at runtime initialization, used for lazy compilation requests.
47
- * @type {string}
48
- */
49
- clientId;
50
-
51
- /**
52
- * @param {string} clientId
53
- */
54
- constructor(clientId) {
55
- this.clientId = clientId;
56
- }
57
-
58
- /**
59
- * Static import edges from `registerGraph` — entries persist across `removeModuleCache`
60
- * and change only by replacement from a newer payload (last write wins).
61
- * @type {Map<string, { edges: string[] }>}
62
- */
63
- staticImports = new Map();
64
- /**
65
- * Reverse index over the static imports.
66
- * @type {Map<string, Set<string>>}
67
- */
68
- importers = new Map();
69
- /**
70
- * Dynamic `import()` edges from `registerGraph`, keyed by importer — mirror of
71
- * `staticImports` for the dynamic reverse index.
72
- * @type {Map<string, { edges: string[] }>}
73
- */
74
- dynamicImports = new Map();
75
- /**
76
- * Reverse index over the dynamic imports.
77
- * @type {Map<string, Set<string>>}
78
- */
79
- dynamicImporters = new Map();
80
- /**
81
- * The module cache. Membership means "this module's side effects ran in this tab" —
82
- * registration is emitted ahead of every module body, and nothing un-registers on
83
- * unwind, so a factory that throws mid-body stays registered. A `Map` rather than a
84
- * plain object: HMR eviction deletes entries, and a `delete` on an object drops V8
85
- * into dictionary mode, taxing every later lookup on the hottest read path.
86
- * @type {Map<string, Module>}
87
- */
88
- moduleCache = new Map();
89
- /**
90
- * Re-runnable factories from HMR patches and lazy chunks. The initial bundle stays
91
- * scope-hoisted and contributes none.
92
- * @type {Map<string, (id: string) => void>}
93
- */
94
- factories = new Map();
95
- /**
96
- * Installed by the dev client at boot. The runtime is a store + executor and makes
97
- * no HMR decisions; accepting, disposing, and reloading live behind these hooks.
98
- * @type {DevRuntimeHooks | null}
99
- */
100
- hooks = null;
101
-
102
- /**
103
- * @param {ModuleGraphDelta} delta
104
- */
105
- registerGraph(delta) {
106
- for (let i = 0; i < delta.localCount; i++) {
107
- const id = delta.ids[i];
108
- const edges = delta.edges[i].map((j) => delta.ids[j]);
109
- for (const target of this.staticImports.get(id)?.edges ?? []) {
110
- this.importers.get(target)?.delete(id);
111
- }
112
- for (const target of edges) {
113
- let importerSet = this.importers.get(target);
114
- if (!importerSet) {
115
- importerSet = new Set();
116
- this.importers.set(target, importerSet);
117
- }
118
- importerSet.add(id);
119
- }
120
- this.staticImports.set(id, { edges });
121
-
122
- // Dynamic `import()` edges are maintained in a parallel reverse index with the same
123
- // last-write-wins bookkeeping; `getImporters` unions the two.
124
- const dynamicEdges = (delta.dynamicEdges?.[i] ?? []).map((j) => delta.ids[j]);
125
- for (const target of this.dynamicImports.get(id)?.edges ?? []) {
126
- this.dynamicImporters.get(target)?.delete(id);
127
- }
128
- for (const target of dynamicEdges) {
129
- let importerSet = this.dynamicImporters.get(target);
130
- if (!importerSet) {
131
- importerSet = new Set();
132
- this.dynamicImporters.set(target, importerSet);
133
- }
134
- importerSet.add(id);
135
- }
136
- this.dynamicImports.set(id, { edges: dynamicEdges });
137
- }
138
- }
139
-
140
- /**
141
- * @param {string} id
142
- * @param {(id: string) => void} fn
143
- */
144
- registerFactory(id, fn) {
145
- this.factories.set(id, fn);
146
- }
147
-
148
- /**
149
- * @param {string} id
150
- * @param {{ exports: any }} [exportsHolder]
151
- */
152
- registerModule(id, exportsHolder = { exports: {} }) {
153
- const module = new Module(id);
154
- module.exportsHolder = exportsHolder;
155
- this.moduleCache.set(id, module);
156
- }
157
-
158
- /**
159
- * @param {string} id
160
- * @returns {string[]}
161
- */
162
- getImporters(id) {
163
- // Static ∪ dynamic importers — the boundary walk treats both kinds the same (parity
164
- // with Vite `node.importers` / webpack `module.parents`). Deduped so a module that
165
- // imports `id` both statically and via `import()` appears once.
166
- const dynamic = this.dynamicImporters.get(id);
167
- if (!dynamic || dynamic.size === 0) {
168
- return [...(this.importers.get(id) ?? [])];
169
- }
170
- return [...new Set([...(this.importers.get(id) ?? []), ...dynamic])];
171
- }
172
-
173
- /**
174
- * @param {string} id
175
- */
176
- isExecuted(id) {
177
- return this.moduleCache.has(id);
178
- }
179
-
180
- /**
181
- * @param {string} id
182
- */
183
- hasFactory(id) {
184
- return this.factories.has(id);
185
- }
186
-
187
- /**
188
- * Module-cache delete only — static imports and factories persist. Removal is what
189
- * re-arms a cache-gated factory for `initModule`.
190
- * @param {string} id
191
- */
192
- removeModuleCache(id) {
193
- this.moduleCache.delete(id);
194
- this.hooks?.onModuleCacheRemoval(id);
195
- }
196
-
197
- /**
198
- * The one re-execution gate: registered → return the live exports; otherwise run the
199
- * mapped factory (which registers itself first, then runs the body).
200
- * @param {string} id
201
- */
202
- initModule(id) {
203
- if (this.moduleCache.has(id)) {
204
- return this.loadExports(id);
205
- }
206
- const factory = this.factories.get(id);
207
- if (!factory) {
208
- throw new MissingFactoryError(id);
209
- }
210
- factory(id);
211
- return this.loadExports(id);
212
- }
213
-
214
- /**
215
- * @param {string} id
216
- */
217
- loadExports(id) {
218
- const module = this.moduleCache.get(id);
219
- if (module) {
220
- return module.exportsHolder.exports;
221
- } else {
222
- console.warn(`Module ${id} not found`);
223
- return {};
224
- }
225
- }
226
-
227
- /**
228
- * @param {string} moduleId
229
- */
230
- createModuleHotContext(moduleId) {
231
- if (this.hooks) {
232
- return this.hooks.createModuleHotContext(moduleId);
233
- }
234
- throw new Error('createModuleHotContext requires installed hooks or an override');
235
- }
236
-
237
- /** @internal */
238
- // @ts-expect-error The variable will be injected at build time.
239
- __toESM = __toESM;
240
- /** @internal */
241
- // @ts-expect-error The variable will be injected at build time.
242
- __toCommonJS = __toCommonJS;
243
- /** @internal */
244
- // @ts-expect-error The variable will be injected at build time.
245
- __exportAll = __exportAll;
246
- /**
247
- * @param {boolean} [isNodeMode]
248
- * @returns {(mod: any) => any}
249
- * @internal
250
- */
251
- // @ts-expect-error The variable will be injected at build time.
252
- __toDynamicImportESM = (isNodeMode) => (mod) => __toESM(mod.default, isNodeMode);
253
- /** @internal */
254
- // @ts-expect-error The variable will be injected at build time.
255
- __reExport = __reExport;
256
- }
55
+ * Compiler-emitted module-graph delta — topology (static + dynamic edges).
56
+ * `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
57
+ * `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
58
+ * `bindings[i][j]` are the export names `ids[i]` imports through `edges[i][j]`. `bindings` holds
59
+ * only some rows; a missing row, or a missing or `null` entry, means the whole namespace.
60
+ * `dynamicEdges` also holds only some rows; a missing row means no dynamic edges.
61
+ * @typedef {{ ids: string[], localCount: number, edges: number[][], bindings?: Record<number, (string[] | null)[]>, dynamicEdges?: Record<number, number[]> }} ModuleGraphDelta
62
+ * @typedef {{ createModuleHotContext(moduleId: string): any, onModuleCacheRemoval(moduleId: string): void }} DevRuntimeHooks
63
+ */
64
+ var MissingFactoryError = class extends Error {
65
+ /**
66
+ * @param {string} id
67
+ */
68
+ constructor(id) {
69
+ super(`No factory registered for module ${id}`);
70
+ this.id = id;
71
+ }
72
+ };
73
+ var DevRuntime = class {
74
+ /**
75
+ * Client ID generated at runtime initialization, used for lazy compilation requests.
76
+ * @type {string}
77
+ */
78
+ clientId;
79
+ /**
80
+ * @param {string} clientId
81
+ */
82
+ constructor(clientId) {
83
+ this.clientId = clientId;
84
+ }
85
+ /**
86
+ * Static import edges from `registerGraph` — entries persist across `removeModuleCache`
87
+ * and change only by replacement from a newer payload (last write wins).
88
+ * `bindings` is the payload row as sent; `getImportedBindings` resolves a missing entry.
89
+ * @type {Map<string, { edges: string[], bindings: (string[] | null)[] | undefined }>}
90
+ */
91
+ staticImports = /* @__PURE__ */ new Map();
92
+ /**
93
+ * Reverse index over the static imports.
94
+ * @type {Map<string, Set<string>>}
95
+ */
96
+ importers = /* @__PURE__ */ new Map();
97
+ /**
98
+ * Dynamic `import()` edges from `registerGraph`, keyed by importer — mirror of
99
+ * `staticImports` for the dynamic reverse index.
100
+ * @type {Map<string, { edges: string[] }>}
101
+ */
102
+ dynamicImports = /* @__PURE__ */ new Map();
103
+ /**
104
+ * Reverse index over the dynamic imports.
105
+ * @type {Map<string, Set<string>>}
106
+ */
107
+ dynamicImporters = /* @__PURE__ */ new Map();
108
+ /**
109
+ * The module cache. Membership means "this module's side effects ran in this tab" —
110
+ * registration is emitted ahead of every module body, and nothing un-registers on
111
+ * unwind, so a factory that throws mid-body stays registered. A `Map` rather than a
112
+ * plain object: HMR eviction deletes entries, and a `delete` on an object drops V8
113
+ * into dictionary mode, taxing every later lookup on the hottest read path.
114
+ * @type {Map<string, Module>}
115
+ */
116
+ moduleCache = /* @__PURE__ */ new Map();
117
+ /**
118
+ * Re-runnable factories from HMR patches and lazy chunks. The initial bundle stays
119
+ * scope-hoisted and contributes none.
120
+ * @type {Map<string, (id: string) => void>}
121
+ */
122
+ factories = /* @__PURE__ */ new Map();
123
+ /**
124
+ * Installed by the dev client at boot. The runtime is a store + executor and makes
125
+ * no HMR decisions; accepting, disposing, and reloading live behind these hooks.
126
+ * @type {DevRuntimeHooks | null}
127
+ */
128
+ hooks = null;
129
+ /**
130
+ * @param {ModuleGraphDelta} delta
131
+ */
132
+ registerGraph(delta) {
133
+ for (let i = 0; i < delta.localCount; i++) {
134
+ const id = delta.ids[i];
135
+ const edges = delta.edges[i].map((j) => delta.ids[j]);
136
+ for (const target of this.staticImports.get(id)?.edges ?? []) this.importers.get(target)?.delete(id);
137
+ for (const target of edges) {
138
+ let importerSet = this.importers.get(target);
139
+ if (!importerSet) {
140
+ importerSet = /* @__PURE__ */ new Set();
141
+ this.importers.set(target, importerSet);
142
+ }
143
+ importerSet.add(id);
144
+ }
145
+ this.staticImports.set(id, {
146
+ edges,
147
+ bindings: delta.bindings?.[i]
148
+ });
149
+ const dynamicEdges = (delta.dynamicEdges?.[i] ?? []).map((j) => delta.ids[j]);
150
+ for (const target of this.dynamicImports.get(id)?.edges ?? []) this.dynamicImporters.get(target)?.delete(id);
151
+ for (const target of dynamicEdges) {
152
+ let importerSet = this.dynamicImporters.get(target);
153
+ if (!importerSet) {
154
+ importerSet = /* @__PURE__ */ new Set();
155
+ this.dynamicImporters.set(target, importerSet);
156
+ }
157
+ importerSet.add(id);
158
+ }
159
+ this.dynamicImports.set(id, { edges: dynamicEdges });
160
+ }
161
+ }
162
+ /**
163
+ * @param {string} id
164
+ * @param {(id: string) => void} fn
165
+ */
166
+ registerFactory(id, fn) {
167
+ this.factories.set(id, fn);
168
+ }
169
+ /**
170
+ * @param {string} id
171
+ * @param {{ exports: any }} [exportsHolder]
172
+ */
173
+ registerModule(id, exportsHolder = { exports: {} }) {
174
+ const module = new Module(id);
175
+ module.exportsHolder = exportsHolder;
176
+ this.moduleCache.set(id, module);
177
+ }
178
+ /**
179
+ * @param {string} id
180
+ * @returns {string[]}
181
+ */
182
+ getImporters(id) {
183
+ const dynamic = this.dynamicImporters.get(id);
184
+ if (!dynamic || dynamic.size === 0) return [...this.importers.get(id) ?? []];
185
+ return [.../* @__PURE__ */ new Set([...this.importers.get(id) ?? [], ...dynamic])];
186
+ }
187
+ /**
188
+ * `"*"` means the whole namespace, an empty list a side-effect-only import, `undefined` no edge.
189
+ * @param {string} importer
190
+ * @param {string} id
191
+ * @returns {string[] | undefined}
192
+ */
193
+ getImportedBindings(importer, id) {
194
+ const record = this.staticImports.get(importer);
195
+ const j = record ? record.edges.indexOf(id) : -1;
196
+ const names = j === -1 ? void 0 : record?.bindings?.[j] ?? ["*"];
197
+ if (!this.dynamicImports.get(importer)?.edges.includes(id)) return names;
198
+ if (!names) return ["*"];
199
+ return names.includes("*") ? names : [...names, "*"];
200
+ }
201
+ /**
202
+ * @param {string} id
203
+ */
204
+ isExecuted(id) {
205
+ return this.moduleCache.has(id);
206
+ }
207
+ /**
208
+ * @param {string} id
209
+ */
210
+ hasFactory(id) {
211
+ return this.factories.has(id);
212
+ }
213
+ /**
214
+ * Module-cache delete only — static imports and factories persist. Removal is what
215
+ * re-arms a cache-gated factory for `initModule`.
216
+ * @param {string} id
217
+ */
218
+ removeModuleCache(id) {
219
+ this.moduleCache.delete(id);
220
+ this.hooks?.onModuleCacheRemoval(id);
221
+ }
222
+ /**
223
+ * The one re-execution gate: registered → return the live exports; otherwise run the
224
+ * mapped factory (which registers itself first, then runs the body).
225
+ * @param {string} id
226
+ */
227
+ initModule(id) {
228
+ if (this.moduleCache.has(id)) return this.loadExports(id);
229
+ const factory = this.factories.get(id);
230
+ if (!factory) throw new MissingFactoryError(id);
231
+ factory(id);
232
+ return this.loadExports(id);
233
+ }
234
+ /**
235
+ * @param {string} id
236
+ */
237
+ loadExports(id) {
238
+ const module = this.moduleCache.get(id);
239
+ if (module) return module.exportsHolder.exports;
240
+ else {
241
+ console.warn(`Module ${id} not found`);
242
+ return {};
243
+ }
244
+ }
245
+ /**
246
+ * @param {string} moduleId
247
+ */
248
+ createModuleHotContext(moduleId) {
249
+ if (this.hooks) return this.hooks.createModuleHotContext(moduleId);
250
+ throw new Error("createModuleHotContext requires installed hooks or an override");
251
+ }
252
+ /** @internal */
253
+ __toESM = __toESM;
254
+ /** @internal */
255
+ __toCommonJS = __toCommonJS;
256
+ /** @internal */
257
+ __exportAll = __exportAll;
258
+ /**
259
+ * @param {boolean} [isNodeMode]
260
+ * @returns {(mod: any) => any}
261
+ * @internal
262
+ */
263
+ __toDynamicImportESM = (isNodeMode) => (mod) => __toESM(mod.default, isNodeMode);
264
+ /** @internal */
265
+ __reExport = __reExport;
266
+ };
267
+ //#endregion
268
+ export { DevRuntime, MissingFactoryError };
@@ -1,4 +1,4 @@
1
- import { F as withFilter } from "./shared/define-config-C7HCoqY8.mjs";
1
+ import { F as withFilter } from "./shared/define-config-kIZKjX8Q.mjs";
2
2
  //#region ../../../node_modules/.pnpm/@rolldown+pluginutils@1.0.1/node_modules/@rolldown/pluginutils/dist/filter/index.d.mts
3
3
  //#region src/filter/composable-filters.d.ts
4
4
  type StringOrRegExp = string | RegExp;
@@ -1,4 +1,4 @@
1
1
  import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./shared/logging-xuHO4mAy.mjs";
2
- import { U as PreRenderedChunk } from "./shared/binding-BTa6BPQe.mjs";
3
- import { A as ResolvedId, At as ChunkFileNamesFunction, B as ExistingRawSourceMap, Bt as MinifyOptions, C as ParallelPluginHooks, Ct as RolldownBuild, D as ResolveFileUrlArgs, Dt as AdvancedChunksGroup, E as PluginMeta, Et as AddonFunction, Ft as CommentsOptions, G as EmittedAsset, Gt as PartialNull, H as OutputBundle, Ht as OutputOptions, It as GeneratedCodeOptions, J as EmittedPrebuiltChunk, Jt as OutputChunk, K as EmittedChunk, L as RUNTIME_MODULE_ID, Lt as GeneratedCodePreset, M as RolldownPluginOption, Mt as CodeSplittingGroup, N as SourceDescription, Nt as CodeSplittingNameFunction, O as ResolveIdExtraOptions, Ot as AdvancedChunksOptions, P as TransformResult, Pt as CodeSplittingOptions, Q as DefineParallelPluginResult, Qt as SourceMap, R as VERSION, Rt as GlobalsFunction, S as ObjectHook, St as rolldown, T as Plugin, Tt as build, U as TreeshakingOptions, Ut as PreRenderedAsset, V as SourceMapInput, Vt as ModuleFormat, W as TransformPluginContext, X as PluginContext, Xt as RenderedModule, Y as GetModuleInfo, Yt as RenderedChunk, Z as PluginContextResolveOptions, Zt as RolldownOutput, _ as HookFilterExtension, _t as watch, a as ChunkOptimizationOptions, at as BufferEncoding, b as ModuleOptions, bt as RolldownWatcherWatcherEventMap, c as InputOption, ct as RolldownFsModule, d as OptimizationOptions, dt as NormalizedInputOptions, en as ModuleInfo, et as MinimalPluginContext, f as WatcherFileWatcherOptions, ft as TransformOptions, g as FunctionPluginHooks, gt as RolldownMagicString, h as CustomPluginOptions, ht as WarningHandlerWithDefault, i as RolldownOptions, it as ModuleTypeFilter, j as RolldownPlugin, jt as ChunkingContext, k as ResolveIdResult, kt as BuiltinModuleTag, l as InputOptions, lt as InternalModuleFormat, m as AsyncPluginHooks, mt as LoggingFunction, n as RolldownOptionsFunction, nt as GeneralHookFilter, o as ExternalOption, ot as RolldownDirectoryEntry, p as WatcherOptions, pt as ChecksOptions, q as EmittedFile, qt as OutputAsset, r as defineConfig, rt as HookFilter, s as ExternalOptionFunction, st as RolldownFileStats, t as ConfigExport, tn as SourcemapIgnoreListOption, tt as PluginContextMeta, u as ModuleTypes, ut as NormalizedOutputOptions, v as ImportKind, vt as RolldownWatcher, w as PartialResolvedId, wt as BuildOptions, x as ModuleType, xt as WatchOptions, y as LoadResult, yt as RolldownWatcherEvent, z as BundleError, zt as ManglePropertiesOptions } from "./shared/define-config-C7HCoqY8.mjs";
4
- export { type AddonFunction, type AdvancedChunksGroup, type AdvancedChunksOptions, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, type BuiltinModuleTag, type BundleError, type ChecksOptions, type ChunkFileNamesFunction, type ChunkOptimizationOptions, type ChunkingContext, type CodeSplittingGroup, type CodeSplittingNameFunction, type CodeSplittingOptions, type CommentsOptions, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedChunk, type EmittedFile, type EmittedPrebuiltChunk, type ExistingRawSourceMap, type ExternalOption, type ExternalOptionFunction, type FunctionPluginHooks, type GeneralHookFilter, type GeneratedCodeOptions, type GeneratedCodePreset, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, type ManglePropertiesOptions, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PluginContextResolveOptions, type PluginMeta, type PreRenderedAsset, type PreRenderedChunk, RUNTIME_MODULE_ID, type RenderedChunk, type RenderedModule, type ResolveFileUrlArgs, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownError, type RolldownError as RollupError, type RolldownFileStats, type RolldownFsModule, type RolldownLog, type RolldownLog as RollupLog, type RolldownLogWithString, type RolldownLogWithString as RollupLogWithString, RolldownMagicString, type RolldownOptions, type RolldownOptionsFunction, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RolldownWatcherWatcherEventMap, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, type TransformOptions, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherFileWatcherOptions, type WatcherOptions, build, defineConfig, rolldown, watch };
2
+ import { U as PreRenderedChunk } from "./shared/binding-tzp6Hc_3.mjs";
3
+ import { $t as SourceMap, A as ResolvedId, At as ChunkFileNamesFunction, B as ExistingRawSourceMap, Bt as ManglePropertiesOptions, C as ParallelPluginHooks, Ct as RolldownBuild, D as ResolveFileUrlArgs, Dt as AdvancedChunksGroup, E as PluginMeta, Et as AddonFunction, Ft as CommentsOptions, G as EmittedAsset, H as OutputBundle, Ht as ModuleFormat, It as ExperimentalInlineCommonChunksOptions, J as EmittedPrebuiltChunk, Jt as OutputAsset, K as EmittedChunk, Kt as PartialNull, L as RUNTIME_MODULE_ID, Lt as GeneratedCodeOptions, M as RolldownPluginOption, Mt as CodeSplittingGroup, N as SourceDescription, Nt as CodeSplittingNameFunction, O as ResolveIdExtraOptions, Ot as AdvancedChunksOptions, P as TransformResult, Pt as CodeSplittingOptions, Q as DefineParallelPluginResult, Qt as RolldownOutput, R as VERSION, Rt as GeneratedCodePreset, S as ObjectHook, St as rolldown, T as Plugin, Tt as build, U as TreeshakingOptions, Ut as OutputOptions, V as SourceMapInput, Vt as MinifyOptions, W as TransformPluginContext, Wt as PreRenderedAsset, X as PluginContext, Xt as RenderedChunk, Y as GetModuleInfo, Yt as OutputChunk, Z as PluginContextResolveOptions, Zt as RenderedModule, _ as HookFilterExtension, _t as watch, a as ChunkOptimizationOptions, at as BufferEncoding, b as ModuleOptions, bt as RolldownWatcherWatcherEventMap, c as InputOption, ct as RolldownFsModule, d as OptimizationOptions, dt as NormalizedInputOptions, et as MinimalPluginContext, f as WatcherFileWatcherOptions, ft as TransformOptions, g as FunctionPluginHooks, gt as RolldownMagicString, h as CustomPluginOptions, ht as WarningHandlerWithDefault, i as RolldownOptions, it as ModuleTypeFilter, j as RolldownPlugin, jt as ChunkingContext, k as ResolveIdResult, kt as BuiltinModuleTag, l as InputOptions, lt as InternalModuleFormat, m as AsyncPluginHooks, mt as LoggingFunction, n as RolldownOptionsFunction, nn as SourcemapIgnoreListOption, nt as GeneralHookFilter, o as ExternalOption, ot as RolldownDirectoryEntry, p as WatcherOptions, pt as ChecksOptions, q as EmittedFile, r as defineConfig, rt as HookFilter, s as ExternalOptionFunction, st as RolldownFileStats, t as ConfigExport, tn as ModuleInfo, tt as PluginContextMeta, u as ModuleTypes, ut as NormalizedOutputOptions, v as ImportKind, vt as RolldownWatcher, w as PartialResolvedId, wt as BuildOptions, x as ModuleType, xt as WatchOptions, y as LoadResult, yt as RolldownWatcherEvent, z as BundleError, zt as GlobalsFunction } from "./shared/define-config-kIZKjX8Q.mjs";
4
+ export { type AddonFunction, type AdvancedChunksGroup, type AdvancedChunksOptions, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, type BuiltinModuleTag, type BundleError, type ChecksOptions, type ChunkFileNamesFunction, type ChunkOptimizationOptions, type ChunkingContext, type CodeSplittingGroup, type CodeSplittingNameFunction, type CodeSplittingOptions, type CommentsOptions, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedChunk, type EmittedFile, type EmittedPrebuiltChunk, type ExistingRawSourceMap, type ExperimentalInlineCommonChunksOptions, type ExternalOption, type ExternalOptionFunction, type FunctionPluginHooks, type GeneralHookFilter, type GeneratedCodeOptions, type GeneratedCodePreset, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, type ManglePropertiesOptions, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PluginContextResolveOptions, type PluginMeta, type PreRenderedAsset, type PreRenderedChunk, RUNTIME_MODULE_ID, type RenderedChunk, type RenderedModule, type ResolveFileUrlArgs, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownError, type RolldownError as RollupError, type RolldownFileStats, type RolldownFsModule, type RolldownLog, type RolldownLog as RollupLog, type RolldownLogWithString, type RolldownLogWithString as RollupLogWithString, RolldownMagicString, type RolldownOptions, type RolldownOptionsFunction, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RolldownWatcherWatcherEventMap, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, type TransformOptions, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherFileWatcherOptions, type WatcherOptions, build, defineConfig, rolldown, watch };
@@ -1,7 +1,7 @@
1
- import { n as __toESM, t as require_binding } from "./shared/binding-BY0qR5iS.mjs";
2
- import { n as onExit, t as watch } from "./shared/watch-RXhXN1aG.mjs";
3
- import { T as VERSION, s as RolldownMagicString } from "./shared/bindingify-input-options-B8JHmN6_.mjs";
4
- import { t as rolldown } from "./shared/rolldown-Bue0gNT5.mjs";
1
+ import { n as __toESM, t as require_binding } from "./shared/binding-B4m_2rFW.mjs";
2
+ import { n as onExit, t as watch } from "./shared/watch-CXhrnblH.mjs";
3
+ import { T as VERSION, s as RolldownMagicString } from "./shared/bindingify-input-options-YtcpaV3r.mjs";
4
+ import { t as rolldown } from "./shared/rolldown-BCQsxZbq.mjs";
5
5
  import { t as defineConfig } from "./shared/define-config-Demdg3_4.mjs";
6
6
  import { isMainThread } from "node:worker_threads";
7
7
  //#region src/setup.ts
@@ -1,5 +1,5 @@
1
- import { n as __toESM, t as require_binding } from "./shared/binding-BY0qR5iS.mjs";
2
- import { c as PluginContextData, n as bindingifyPlugin } from "./shared/bindingify-input-options-B8JHmN6_.mjs";
1
+ import { n as __toESM, t as require_binding } from "./shared/binding-B4m_2rFW.mjs";
2
+ import { c as PluginContextData, n as bindingifyPlugin } from "./shared/bindingify-input-options-YtcpaV3r.mjs";
3
3
  import { parentPort, workerData } from "node:worker_threads";
4
4
  //#region src/parallel-plugin-worker.ts
5
5
  var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
@@ -1,4 +1,4 @@
1
- import { T as Plugin, Wt as MaybePromise } from "./shared/define-config-C7HCoqY8.mjs";
1
+ import { Gt as MaybePromise, T as Plugin } from "./shared/define-config-kIZKjX8Q.mjs";
2
2
  //#region src/plugin/parallel-plugin-implementation.d.ts
3
3
  type ParallelPluginImplementation = Plugin;
4
4
  type Context = {
@@ -1,4 +1,4 @@
1
- import { H as ParserOptions$1, V as ParseResult$1 } from "./shared/binding-BTa6BPQe.mjs";
1
+ import { H as ParserOptions$1, V as ParseResult$1 } from "./shared/binding-tzp6Hc_3.mjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
  //#region src/parse-ast-index.d.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { d as locate, f as getCodeFrame, l as logParseError, n as error, t as augmentCodeLocation } from "./shared/logs-D6uA606S.mjs";
2
- import { n as parseSync, t as parse } from "./shared/parse-BWeE7Vr9.mjs";
2
+ import { n as parseSync, t as parse } from "./shared/parse-Zii6QoPp.mjs";
3
3
  //#region src/parse-ast-index.ts
4
4
  function wrap(result, filename, sourceText) {
5
5
  if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
@@ -1,6 +1,6 @@
1
- import { _ as BindingReplacePluginConfig } from "./shared/binding-BTa6BPQe.mjs";
2
- import { I as BuiltinPlugin } from "./shared/define-config-C7HCoqY8.mjs";
3
- import { t as esmExternalRequirePlugin } from "./shared/constructors-DuOq7MqW.mjs";
1
+ import { _ as BindingReplacePluginConfig } from "./shared/binding-tzp6Hc_3.mjs";
2
+ import { I as BuiltinPlugin } from "./shared/define-config-kIZKjX8Q.mjs";
3
+ import { t as esmExternalRequirePlugin } from "./shared/constructors-CGQ9ItSV.mjs";
4
4
  //#region src/builtin-plugin/replace-plugin.d.ts
5
5
  /**
6
6
  * Replaces targeted strings in files while bundling.
@@ -1,5 +1,5 @@
1
- import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-F14uvr6D.mjs";
2
- import { t as esmExternalRequirePlugin } from "./shared/constructors-xEvVj3lN.mjs";
1
+ import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-xyy0kCQR.mjs";
2
+ import { t as esmExternalRequirePlugin } from "./shared/constructors-DDRbtWM1.mjs";
3
3
  //#region src/builtin-plugin/replace-plugin.ts
4
4
  /**
5
5
  * Replaces targeted strings in files while bundling.