@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.
- package/LICENSE +29 -176
- package/dist/rolldown/cli.mjs +9 -8
- package/dist/rolldown/config.d.mts +1 -1
- package/dist/rolldown/config.mjs +2 -2
- package/dist/rolldown/experimental-index.d.mts +4 -4
- package/dist/rolldown/experimental-index.mjs +8 -8
- package/dist/rolldown/experimental-runtime-types.d.ts +25 -6
- package/dist/rolldown/experimental-runtime.d.ts +25 -6
- package/dist/rolldown/experimental-runtime.mjs +267 -255
- package/dist/rolldown/filter-index.d.mts +1 -1
- package/dist/rolldown/index.d.mts +3 -3
- package/dist/rolldown/index.mjs +4 -4
- package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
- package/dist/rolldown/parallel-plugin.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.mjs +1 -1
- package/dist/rolldown/plugins-index.d.mts +3 -3
- package/dist/rolldown/plugins-index.mjs +2 -2
- package/dist/rolldown/shared/{binding-BY0qR5iS.mjs → binding-B4m_2rFW.mjs} +27 -28
- package/dist/rolldown/shared/{binding-BTa6BPQe.d.mts → binding-tzp6Hc_3.d.mts} +1 -1
- package/dist/rolldown/shared/{bindingify-input-options-B8JHmN6_.mjs → bindingify-input-options-YtcpaV3r.mjs} +196 -13
- package/dist/rolldown/shared/{constructors-DuOq7MqW.d.mts → constructors-CGQ9ItSV.d.mts} +2 -2
- package/dist/rolldown/shared/{constructors-xEvVj3lN.mjs → constructors-DDRbtWM1.mjs} +1 -1
- package/dist/rolldown/shared/{create-bundler-option-COco-7P6.mjs → create-bundler-option-CFtx335R.mjs} +17 -8
- package/dist/rolldown/shared/{define-config-C7HCoqY8.d.mts → define-config-kIZKjX8Q.d.mts} +72 -2
- package/dist/rolldown/shared/{error-C7pxws0W.mjs → error-Bj1xBdEY.mjs} +2 -1
- package/dist/rolldown/shared/{load-config-DkUBnDsI.mjs → load-config-CiFPv7UH.mjs} +2 -2
- package/dist/rolldown/shared/{normalize-string-or-regex-F14uvr6D.mjs → normalize-string-or-regex-xyy0kCQR.mjs} +1 -1
- package/dist/rolldown/shared/{parse-BWeE7Vr9.mjs → parse-Zii6QoPp.mjs} +2 -2
- package/dist/rolldown/shared/{resolve-tsconfig-DHwpIs5e.mjs → resolve-tsconfig-DRWFAQ3v.mjs} +2 -2
- package/dist/rolldown/shared/{rolldown-Bue0gNT5.mjs → rolldown-BCQsxZbq.mjs} +4 -4
- package/dist/rolldown/shared/{transform-DK_nCt9j.d.mts → transform-D4RDjIPI.d.mts} +1 -1
- package/dist/rolldown/shared/{watch-RXhXN1aG.mjs → watch-CXhrnblH.mjs} +4 -4
- package/dist/rolldown/utils-index.d.mts +3 -3
- package/dist/rolldown/utils-index.mjs +5 -5
- package/dist/tsdown/{build-JVmLFaZt-DRlLhpV3.js → build-JVmLFaZt-k6Y-YuG9.js} +8 -8
- package/dist/tsdown/{debug-CpC4hV25-C-OYr2iI.js → debug-CpC4hV25-D_60QWpz.js} +2 -2
- package/dist/tsdown/{detect-Bg-d8iUV-Du8LljhG.js → detect-Bg-d8iUV--_V5C4Db.js} +1 -1
- package/dist/tsdown/{dist-VDcV1Qyy.js → dist-DquISSoY.js} +8 -8
- package/dist/tsdown/index-types.d.ts +5 -5
- package/dist/tsdown/index.js +4 -4
- package/dist/tsdown/{require-BbBF8Ii0-BDaWJgzA.js → require-BbBF8Ii0-S6Y65RhW.js} +1 -1
- package/dist/tsdown/{resolver-DE0_sy8o-Bi3xbRxi.js → resolver-DE0_sy8o-Pz8aksn9.js} +2 -2
- package/dist/tsdown/run.js +3 -3
- package/dist/tsdown/{target-DgdLrXba-DpO9JXxB.js → target-DgdLrXba-BygiKCU8.js} +3 -3
- package/dist/tsdown/{tsc-BLb4pSBY.js → tsc-2xhsE0Bf.js} +4 -4
- package/dist/tsdown/tsdown-css.js +1 -1
- package/dist/tsdown/tsdown-exe.js +3 -3
- package/dist/tsdown/{version-CQ98ZBpL-D6GAHapk.js → version-CQ98ZBpL-CKvh-HCu.js} +1 -1
- package/dist/vite/client/bundledDevClient.mjs +75 -329
- package/dist/vite/client/client.mjs +74 -23
- package/dist/vite/node/chunks/node.js +883 -666
- package/dist/vite/node/index.d.ts +3 -1
- package/dist/vite/node/module-runner.js +16 -2
- package/package.json +38 -21
- package/dist/rolldown/experimental-default-runtime.mjs +0 -116
- package/dist/rolldown/experimental-runtime-base.mjs +0 -95
|
@@ -1,256 +1,268 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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-
|
|
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-
|
|
3
|
-
import { A as ResolvedId, At as ChunkFileNamesFunction, B as ExistingRawSourceMap, Bt as
|
|
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 };
|
package/dist/rolldown/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./shared/binding-
|
|
2
|
-
import { n as onExit, t as watch } from "./shared/watch-
|
|
3
|
-
import { T as VERSION, s as RolldownMagicString } from "./shared/bindingify-input-options-
|
|
4
|
-
import { t as rolldown } from "./shared/rolldown-
|
|
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-
|
|
2
|
-
import { c as PluginContextData, n as bindingifyPlugin } from "./shared/bindingify-input-options-
|
|
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 {
|
|
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-
|
|
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-
|
|
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-
|
|
2
|
-
import { I as BuiltinPlugin } from "./shared/define-config-
|
|
3
|
-
import { t as esmExternalRequirePlugin } from "./shared/constructors-
|
|
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-
|
|
2
|
-
import { t as esmExternalRequirePlugin } from "./shared/constructors-
|
|
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.
|