vite 6.3.5 → 7.1.5

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 (39) hide show
  1. package/LICENSE.md +81 -314
  2. package/bin/openChrome.js +68 -0
  3. package/bin/vite.js +7 -7
  4. package/dist/client/client.mjs +886 -922
  5. package/dist/client/env.mjs +14 -19
  6. package/dist/node/chunks/dep-BuoK8Wda.js +377 -0
  7. package/dist/node/chunks/dep-BvyJBvVx.js +4 -0
  8. package/dist/node/chunks/dep-Cs9lwdKu.js +4 -0
  9. package/dist/node/chunks/dep-DCVhRpiz.js +5595 -0
  10. package/dist/node/chunks/dep-DDbTn5rw.js +482 -0
  11. package/dist/node/chunks/dep-D_YDhiNx.js +4 -0
  12. package/dist/node/chunks/dep-M_KD0XSK.js +36707 -0
  13. package/dist/node/chunks/dep-SmwnYDP9.js +320 -0
  14. package/dist/node/chunks/dep-cWFO4sv4.js +4 -0
  15. package/dist/node/chunks/dep-lCKrEJQm.js +31 -0
  16. package/dist/node/chunks/dep-sDKrrA4S.js +6814 -0
  17. package/dist/node/chunks/dep-yxQqhtZq.js +4 -0
  18. package/dist/node/cli.js +624 -865
  19. package/dist/node/index.d.ts +2723 -3277
  20. package/dist/node/index.js +24 -188
  21. package/dist/node/module-runner.d.ts +256 -234
  22. package/dist/node/module-runner.js +1000 -1178
  23. package/dist/node/moduleRunnerTransport-BWUZBVLX.d.ts +88 -0
  24. package/package.json +52 -55
  25. package/types/importGlob.d.ts +14 -0
  26. package/types/internal/cssPreprocessorOptions.d.ts +3 -22
  27. package/types/internal/terserOptions.d.ts +11 -0
  28. package/types/metadata.d.ts +0 -2
  29. package/bin/openChrome.applescript +0 -95
  30. package/dist/node/chunks/dep-3RmXg9uo.js +0 -553
  31. package/dist/node/chunks/dep-AiMcmC_f.js +0 -822
  32. package/dist/node/chunks/dep-CvfTChi5.js +0 -8218
  33. package/dist/node/chunks/dep-DBxKXgDP.js +0 -49496
  34. package/dist/node/chunks/dep-SgSik2vo.js +0 -7113
  35. package/dist/node/constants.js +0 -149
  36. package/dist/node/moduleRunnerTransport.d-DJ_mE5sf.d.ts +0 -87
  37. package/dist/node-cjs/publicUtils.cjs +0 -3986
  38. package/index.cjs +0 -96
  39. package/index.d.cts +0 -6
@@ -1,290 +1,312 @@
1
- import { ModuleNamespace, ViteHotContext } from '../../types/hot.js';
2
- import { Update, HotPayload } from '../../types/hmrPayload.js';
3
- import { InferCustomEventPayload } from '../../types/customEvent.js';
4
- import { N as NormalizedModuleRunnerTransport, E as ExternalFetchResult, V as ViteFetchResult, M as ModuleRunnerTransport, F as FetchFunctionOptions, a as FetchResult } from './moduleRunnerTransport.d-DJ_mE5sf.js';
5
- export { b as ModuleRunnerTransportHandlers, c as createWebSocketModuleRunnerTransport } from './moduleRunnerTransport.d-DJ_mE5sf.js';
1
+ import { ExternalFetchResult, FetchFunctionOptions, FetchResult, ModuleRunnerTransport, ModuleRunnerTransportHandlers, NormalizedModuleRunnerTransport, ViteFetchResult, createWebSocketModuleRunnerTransport } from "./moduleRunnerTransport-BWUZBVLX.js";
2
+ import { ModuleNamespace, ViteHotContext } from "../../types/hot.js";
3
+ import { HotPayload, Update } from "../../types/hmrPayload.js";
4
+ import { InferCustomEventPayload } from "../../types/customEvent.js";
6
5
 
6
+ //#region src/module-runner/sourcemap/decoder.d.ts
7
7
  interface SourceMapLike {
8
- version: number;
9
- mappings?: string;
10
- names?: string[];
11
- sources?: string[];
12
- sourcesContent?: string[];
8
+ version: number;
9
+ mappings?: string;
10
+ names?: string[];
11
+ sources?: string[];
12
+ sourcesContent?: string[];
13
13
  }
14
14
  declare class DecodedMap {
15
- map: SourceMapLike;
16
- _encoded: string;
17
- _decoded: undefined | number[][][];
18
- _decodedMemo: Stats;
19
- url: string;
20
- version: number;
21
- names: string[];
22
- resolvedSources: string[];
23
- constructor(map: SourceMapLike, from: string);
15
+ map: SourceMapLike;
16
+ _encoded: string;
17
+ _decoded: undefined | number[][][];
18
+ _decodedMemo: Stats;
19
+ url: string;
20
+ version: number;
21
+ names: string[];
22
+ resolvedSources: string[];
23
+ constructor(map: SourceMapLike, from: string);
24
24
  }
25
25
  interface Stats {
26
- lastKey: number;
27
- lastNeedle: number;
28
- lastIndex: number;
26
+ lastKey: number;
27
+ lastNeedle: number;
28
+ lastIndex: number;
29
29
  }
30
-
30
+ //#endregion
31
+ //#region src/shared/hmr.d.ts
31
32
  type CustomListenersMap = Map<string, ((data: any) => void)[]>;
32
33
  interface HotModule {
33
- id: string;
34
- callbacks: HotCallback[];
34
+ id: string;
35
+ callbacks: HotCallback[];
35
36
  }
36
37
  interface HotCallback {
37
- deps: string[];
38
- fn: (modules: Array<ModuleNamespace | undefined>) => void;
38
+ deps: string[];
39
+ fn: (modules: Array<ModuleNamespace | undefined>) => void;
39
40
  }
40
41
  interface HMRLogger {
41
- error(msg: string | Error): void;
42
- debug(...msg: unknown[]): void;
42
+ error(msg: string | Error): void;
43
+ debug(...msg: unknown[]): void;
43
44
  }
44
45
  declare class HMRClient {
45
- logger: HMRLogger;
46
- private transport;
47
- private importUpdatedModule;
48
- hotModulesMap: Map<string, HotModule>;
49
- disposeMap: Map<string, (data: any) => void | Promise<void>>;
50
- pruneMap: Map<string, (data: any) => void | Promise<void>>;
51
- dataMap: Map<string, any>;
52
- customListenersMap: CustomListenersMap;
53
- ctxToListenersMap: Map<string, CustomListenersMap>;
54
- currentFirstInvalidatedBy: string | undefined;
55
- constructor(logger: HMRLogger, transport: NormalizedModuleRunnerTransport, importUpdatedModule: (update: Update) => Promise<ModuleNamespace>);
56
- notifyListeners<T extends string>(event: T, data: InferCustomEventPayload<T>): Promise<void>;
57
- send(payload: HotPayload): void;
58
- clear(): void;
59
- prunePaths(paths: string[]): Promise<void>;
60
- protected warnFailedUpdate(err: Error, path: string | string[]): void;
61
- private updateQueue;
62
- private pendingUpdateQueue;
63
- /**
64
- * buffer multiple hot updates triggered by the same src change
65
- * so that they are invoked in the same order they were sent.
66
- * (otherwise the order may be inconsistent because of the http request round trip)
67
- */
68
- queueUpdate(payload: Update): Promise<void>;
69
- private fetchUpdate;
46
+ logger: HMRLogger;
47
+ private transport;
48
+ private importUpdatedModule;
49
+ hotModulesMap: Map<string, HotModule>;
50
+ disposeMap: Map<string, (data: any) => void | Promise<void>>;
51
+ pruneMap: Map<string, (data: any) => void | Promise<void>>;
52
+ dataMap: Map<string, any>;
53
+ customListenersMap: CustomListenersMap;
54
+ ctxToListenersMap: Map<string, CustomListenersMap>;
55
+ currentFirstInvalidatedBy: string | undefined;
56
+ constructor(logger: HMRLogger, transport: NormalizedModuleRunnerTransport, importUpdatedModule: (update: Update) => Promise<ModuleNamespace>);
57
+ notifyListeners<T extends string>(event: T, data: InferCustomEventPayload<T>): Promise<void>;
58
+ send(payload: HotPayload): void;
59
+ clear(): void;
60
+ prunePaths(paths: string[]): Promise<void>;
61
+ protected warnFailedUpdate(err: Error, path: string | string[]): void;
62
+ private updateQueue;
63
+ private pendingUpdateQueue;
64
+ /**
65
+ * buffer multiple hot updates triggered by the same src change
66
+ * so that they are invoked in the same order they were sent.
67
+ * (otherwise the order may be inconsistent because of the http request round trip)
68
+ */
69
+ queueUpdate(payload: Update): Promise<void>;
70
+ private fetchUpdate;
70
71
  }
71
-
72
+ //#endregion
73
+ //#region src/shared/ssrTransform.d.ts
72
74
  interface DefineImportMetadata {
73
- /**
74
- * Imported names before being transformed to `ssrImportKey`
75
- *
76
- * import foo, { bar as baz, qux } from 'hello'
77
- * => ['default', 'bar', 'qux']
78
- *
79
- * import * as namespace from 'world
80
- * => undefined
81
- */
82
- importedNames?: string[];
75
+ /**
76
+ * Imported names before being transformed to `ssrImportKey`
77
+ *
78
+ * import foo, { bar as baz, qux } from 'hello'
79
+ * => ['default', 'bar', 'qux']
80
+ *
81
+ * import * as namespace from 'world
82
+ * => undefined
83
+ */
84
+ importedNames?: string[];
83
85
  }
84
86
  interface SSRImportMetadata extends DefineImportMetadata {
85
- isDynamicImport?: boolean;
87
+ isDynamicImport?: boolean;
86
88
  }
87
-
89
+ /**
90
+ * Vite converts `import { } from 'foo'` to `const _ = __vite_ssr_import__('foo')`.
91
+ * Top-level imports and dynamic imports work slightly differently in Node.js.
92
+ * This function normalizes the differences so it matches prod behaviour.
93
+ */
94
+ //#endregion
95
+ //#region src/module-runner/constants.d.ts
88
96
  declare const ssrModuleExportsKey = "__vite_ssr_exports__";
89
97
  declare const ssrImportKey = "__vite_ssr_import__";
90
98
  declare const ssrDynamicImportKey = "__vite_ssr_dynamic_import__";
91
99
  declare const ssrExportAllKey = "__vite_ssr_exportAll__";
100
+ declare const ssrExportNameKey = "__vite_ssr_exportName__";
92
101
  declare const ssrImportMetaKey = "__vite_ssr_import_meta__";
93
-
102
+ //#endregion
103
+ //#region src/module-runner/runner.d.ts
94
104
  interface ModuleRunnerDebugger {
95
- (formatter: unknown, ...args: unknown[]): void;
105
+ (formatter: unknown, ...args: unknown[]): void;
96
106
  }
97
107
  declare class ModuleRunner {
98
- options: ModuleRunnerOptions;
99
- evaluator: ModuleEvaluator;
100
- private debug?;
101
- evaluatedModules: EvaluatedModules;
102
- hmrClient?: HMRClient;
103
- private readonly envProxy;
104
- private readonly transport;
105
- private readonly resetSourceMapSupport?;
106
- private readonly concurrentModuleNodePromises;
107
- private closed;
108
- constructor(options: ModuleRunnerOptions, evaluator?: ModuleEvaluator, debug?: ModuleRunnerDebugger | undefined);
109
- /**
110
- * URL to execute. Accepts file path, server path or id relative to the root.
111
- */
112
- import<T = any>(url: string): Promise<T>;
113
- /**
114
- * Clear all caches including HMR listeners.
115
- */
116
- clearCache(): void;
117
- /**
118
- * Clears all caches, removes all HMR listeners, and resets source map support.
119
- * This method doesn't stop the HMR connection.
120
- */
121
- close(): Promise<void>;
122
- /**
123
- * Returns `true` if the runtime has been closed by calling `close()` method.
124
- */
125
- isClosed(): boolean;
126
- private processImport;
127
- private isCircularModule;
128
- private isCircularImport;
129
- private cachedRequest;
130
- private cachedModule;
131
- private getModuleInformation;
132
- protected directRequest(url: string, mod: EvaluatedModuleNode, _callstack: string[]): Promise<any>;
108
+ options: ModuleRunnerOptions;
109
+ evaluator: ModuleEvaluator;
110
+ private debug?;
111
+ evaluatedModules: EvaluatedModules;
112
+ hmrClient?: HMRClient;
113
+ private readonly transport;
114
+ private readonly resetSourceMapSupport?;
115
+ private readonly concurrentModuleNodePromises;
116
+ private closed;
117
+ constructor(options: ModuleRunnerOptions, evaluator?: ModuleEvaluator, debug?: ModuleRunnerDebugger | undefined);
118
+ /**
119
+ * URL to execute. Accepts file path, server path or id relative to the root.
120
+ */
121
+ import<T = any>(url: string): Promise<T>;
122
+ /**
123
+ * Clear all caches including HMR listeners.
124
+ */
125
+ clearCache(): void;
126
+ /**
127
+ * Clears all caches, removes all HMR listeners, and resets source map support.
128
+ * This method doesn't stop the HMR connection.
129
+ */
130
+ close(): Promise<void>;
131
+ /**
132
+ * Returns `true` if the runtime has been closed by calling `close()` method.
133
+ */
134
+ isClosed(): boolean;
135
+ private processImport;
136
+ private isCircularModule;
137
+ private isCircularImport;
138
+ private cachedRequest;
139
+ private cachedModule;
140
+ private getModuleInformation;
141
+ protected directRequest(url: string, mod: EvaluatedModuleNode, _callstack: string[]): Promise<any>;
133
142
  }
134
-
143
+ //#endregion
144
+ //#region src/module-runner/sourcemap/interceptor.d.ts
135
145
  interface RetrieveFileHandler {
136
- (path: string): string | null | undefined | false;
146
+ (path: string): string | null | undefined | false;
137
147
  }
138
148
  interface RetrieveSourceMapHandler {
139
- (path: string): null | {
140
- url: string;
141
- map: any;
142
- };
149
+ (path: string): null | {
150
+ url: string;
151
+ map: any;
152
+ };
143
153
  }
144
154
  interface InterceptorOptions {
145
- retrieveFile?: RetrieveFileHandler;
146
- retrieveSourceMap?: RetrieveSourceMapHandler;
155
+ retrieveFile?: RetrieveFileHandler;
156
+ retrieveSourceMap?: RetrieveSourceMapHandler;
147
157
  }
148
-
158
+ //#endregion
159
+ //#region src/module-runner/types.d.ts
149
160
  interface ModuleRunnerImportMeta extends ImportMeta {
150
- url: string;
151
- env: ImportMetaEnv;
152
- hot?: ViteHotContext;
153
- [key: string]: any;
161
+ url: string;
162
+ env: ImportMetaEnv;
163
+ hot?: ViteHotContext;
164
+ [key: string]: any;
154
165
  }
155
166
  interface ModuleRunnerContext {
156
- [ssrModuleExportsKey]: Record<string, any>;
157
- [ssrImportKey]: (id: string, metadata?: DefineImportMetadata) => Promise<any>;
158
- [ssrDynamicImportKey]: (id: string, options?: ImportCallOptions) => Promise<any>;
159
- [ssrExportAllKey]: (obj: any) => void;
160
- [ssrImportMetaKey]: ModuleRunnerImportMeta;
167
+ [ssrModuleExportsKey]: Record<string, any>;
168
+ [ssrImportKey]: (id: string, metadata?: DefineImportMetadata) => Promise<any>;
169
+ [ssrDynamicImportKey]: (id: string, options?: ImportCallOptions) => Promise<any>;
170
+ [ssrExportAllKey]: (obj: any) => void;
171
+ [ssrExportNameKey]: (name: string, getter: () => unknown) => void;
172
+ [ssrImportMetaKey]: ModuleRunnerImportMeta;
161
173
  }
162
174
  interface ModuleEvaluator {
163
- /**
164
- * Number of prefixed lines in the transformed code.
165
- */
166
- startOffset?: number;
167
- /**
168
- * Run code that was transformed by Vite.
169
- * @param context Function context
170
- * @param code Transformed code
171
- * @param module The module node
172
- */
173
- runInlinedModule(context: ModuleRunnerContext, code: string, module: Readonly<EvaluatedModuleNode>): Promise<any>;
174
- /**
175
- * Run externalized module.
176
- * @param file File URL to the external module
177
- */
178
- runExternalModule(file: string): Promise<any>;
175
+ /**
176
+ * Number of prefixed lines in the transformed code.
177
+ */
178
+ startOffset?: number;
179
+ /**
180
+ * Run code that was transformed by Vite.
181
+ * @param context Function context
182
+ * @param code Transformed code
183
+ * @param module The module node
184
+ */
185
+ runInlinedModule(context: ModuleRunnerContext, code: string, module: Readonly<EvaluatedModuleNode>): Promise<any>;
186
+ /**
187
+ * Run externalized module.
188
+ * @param file File URL to the external module
189
+ */
190
+ runExternalModule(file: string): Promise<any>;
179
191
  }
180
192
  type ResolvedResult = (ExternalFetchResult | ViteFetchResult) & {
181
- url: string;
182
- id: string;
193
+ url: string;
194
+ id: string;
183
195
  };
184
196
  type FetchFunction = (id: string, importer?: string, options?: FetchFunctionOptions) => Promise<FetchResult>;
185
197
  interface ModuleRunnerHmr {
186
- /**
187
- * Configure HMR logger.
188
- */
189
- logger?: false | HMRLogger;
198
+ /**
199
+ * Configure HMR logger.
200
+ */
201
+ logger?: false | HMRLogger;
190
202
  }
191
203
  interface ModuleRunnerOptions {
192
- /**
193
- * Root of the project
194
- * @deprecated not used and to be removed
195
- */
196
- root?: string;
197
- /**
198
- * A set of methods to communicate with the server.
199
- */
200
- transport: ModuleRunnerTransport;
201
- /**
202
- * Configure how source maps are resolved. Prefers `node` if `process.setSourceMapsEnabled` is available.
203
- * Otherwise it will use `prepareStackTrace` by default which overrides `Error.prepareStackTrace` method.
204
- * You can provide an object to configure how file contents and source maps are resolved for files that were not processed by Vite.
205
- */
206
- sourcemapInterceptor?: false | 'node' | 'prepareStackTrace' | InterceptorOptions;
207
- /**
208
- * Disable HMR or configure HMR options.
209
- *
210
- * @default true
211
- */
212
- hmr?: boolean | ModuleRunnerHmr;
213
- /**
214
- * Custom module cache. If not provided, creates a separate module cache for each ModuleRunner instance.
215
- */
216
- evaluatedModules?: EvaluatedModules;
204
+ /**
205
+ * A set of methods to communicate with the server.
206
+ */
207
+ transport: ModuleRunnerTransport;
208
+ /**
209
+ * Configure how source maps are resolved. Prefers `node` if `process.setSourceMapsEnabled` is available.
210
+ * Otherwise it will use `prepareStackTrace` by default which overrides `Error.prepareStackTrace` method.
211
+ * You can provide an object to configure how file contents and source maps are resolved for files that were not processed by Vite.
212
+ */
213
+ sourcemapInterceptor?: false | 'node' | 'prepareStackTrace' | InterceptorOptions;
214
+ /**
215
+ * Disable HMR or configure HMR options.
216
+ *
217
+ * @default true
218
+ */
219
+ hmr?: boolean | ModuleRunnerHmr;
220
+ /**
221
+ * Create import.meta object for the module.
222
+ *
223
+ * @default createDefaultImportMeta
224
+ */
225
+ createImportMeta?: (modulePath: string) => ModuleRunnerImportMeta | Promise<ModuleRunnerImportMeta>;
226
+ /**
227
+ * Custom module cache. If not provided, creates a separate module cache for each ModuleRunner instance.
228
+ */
229
+ evaluatedModules?: EvaluatedModules;
217
230
  }
218
231
  interface ImportMetaEnv {
219
- [key: string]: any;
220
- BASE_URL: string;
221
- MODE: string;
222
- DEV: boolean;
223
- PROD: boolean;
224
- SSR: boolean;
232
+ [key: string]: any;
233
+ BASE_URL: string;
234
+ MODE: string;
235
+ DEV: boolean;
236
+ PROD: boolean;
237
+ SSR: boolean;
225
238
  }
226
-
239
+ //#endregion
240
+ //#region src/module-runner/evaluatedModules.d.ts
227
241
  declare class EvaluatedModuleNode {
228
- id: string;
229
- url: string;
230
- importers: Set<string>;
231
- imports: Set<string>;
232
- evaluated: boolean;
233
- meta: ResolvedResult | undefined;
234
- promise: Promise<any> | undefined;
235
- exports: any | undefined;
236
- file: string;
237
- map: DecodedMap | undefined;
238
- constructor(id: string, url: string);
242
+ id: string;
243
+ url: string;
244
+ importers: Set<string>;
245
+ imports: Set<string>;
246
+ evaluated: boolean;
247
+ meta: ResolvedResult | undefined;
248
+ promise: Promise<any> | undefined;
249
+ exports: any | undefined;
250
+ file: string;
251
+ map: DecodedMap | undefined;
252
+ constructor(id: string, url: string);
239
253
  }
240
254
  declare class EvaluatedModules {
241
- readonly idToModuleMap: Map<string, EvaluatedModuleNode>;
242
- readonly fileToModulesMap: Map<string, Set<EvaluatedModuleNode>>;
243
- readonly urlToIdModuleMap: Map<string, EvaluatedModuleNode>;
244
- /**
245
- * Returns the module node by the resolved module ID. Usually, module ID is
246
- * the file system path with query and/or hash. It can also be a virtual module.
247
- *
248
- * Module runner graph will have 1 to 1 mapping with the server module graph.
249
- * @param id Resolved module ID
250
- */
251
- getModuleById(id: string): EvaluatedModuleNode | undefined;
252
- /**
253
- * Returns all modules related to the file system path. Different modules
254
- * might have different query parameters or hash, so it's possible to have
255
- * multiple modules for the same file.
256
- * @param file The file system path of the module
257
- */
258
- getModulesByFile(file: string): Set<EvaluatedModuleNode> | undefined;
259
- /**
260
- * Returns the module node by the URL that was used in the import statement.
261
- * Unlike module graph on the server, the URL is not resolved and is used as is.
262
- * @param url Server URL that was used in the import statement
263
- */
264
- getModuleByUrl(url: string): EvaluatedModuleNode | undefined;
265
- /**
266
- * Ensure that module is in the graph. If the module is already in the graph,
267
- * it will return the existing module node. Otherwise, it will create a new
268
- * module node and add it to the graph.
269
- * @param id Resolved module ID
270
- * @param url URL that was used in the import statement
271
- */
272
- ensureModule(id: string, url: string): EvaluatedModuleNode;
273
- invalidateModule(node: EvaluatedModuleNode): void;
274
- /**
275
- * Extracts the inlined source map from the module code and returns the decoded
276
- * source map. If the source map is not inlined, it will return null.
277
- * @param id Resolved module ID
278
- */
279
- getModuleSourceMapById(id: string): DecodedMap | null;
280
- clear(): void;
255
+ readonly idToModuleMap: Map<string, EvaluatedModuleNode>;
256
+ readonly fileToModulesMap: Map<string, Set<EvaluatedModuleNode>>;
257
+ readonly urlToIdModuleMap: Map<string, EvaluatedModuleNode>;
258
+ /**
259
+ * Returns the module node by the resolved module ID. Usually, module ID is
260
+ * the file system path with query and/or hash. It can also be a virtual module.
261
+ *
262
+ * Module runner graph will have 1 to 1 mapping with the server module graph.
263
+ * @param id Resolved module ID
264
+ */
265
+ getModuleById(id: string): EvaluatedModuleNode | undefined;
266
+ /**
267
+ * Returns all modules related to the file system path. Different modules
268
+ * might have different query parameters or hash, so it's possible to have
269
+ * multiple modules for the same file.
270
+ * @param file The file system path of the module
271
+ */
272
+ getModulesByFile(file: string): Set<EvaluatedModuleNode> | undefined;
273
+ /**
274
+ * Returns the module node by the URL that was used in the import statement.
275
+ * Unlike module graph on the server, the URL is not resolved and is used as is.
276
+ * @param url Server URL that was used in the import statement
277
+ */
278
+ getModuleByUrl(url: string): EvaluatedModuleNode | undefined;
279
+ /**
280
+ * Ensure that module is in the graph. If the module is already in the graph,
281
+ * it will return the existing module node. Otherwise, it will create a new
282
+ * module node and add it to the graph.
283
+ * @param id Resolved module ID
284
+ * @param url URL that was used in the import statement
285
+ */
286
+ ensureModule(id: string, url: string): EvaluatedModuleNode;
287
+ invalidateModule(node: EvaluatedModuleNode): void;
288
+ /**
289
+ * Extracts the inlined source map from the module code and returns the decoded
290
+ * source map. If the source map is not inlined, it will return null.
291
+ * @param id Resolved module ID
292
+ */
293
+ getModuleSourceMapById(id: string): DecodedMap | null;
294
+ clear(): void;
281
295
  }
282
-
296
+ declare function normalizeModuleId(file: string): string;
297
+ //#endregion
298
+ //#region src/module-runner/esmEvaluator.d.ts
283
299
  declare class ESModulesEvaluator implements ModuleEvaluator {
284
- readonly startOffset: number;
285
- runInlinedModule(context: ModuleRunnerContext, code: string): Promise<any>;
286
- runExternalModule(filepath: string): Promise<any>;
300
+ readonly startOffset: number;
301
+ runInlinedModule(context: ModuleRunnerContext, code: string): Promise<any>;
302
+ runExternalModule(filepath: string): Promise<any>;
287
303
  }
288
-
289
- export { ESModulesEvaluator, EvaluatedModuleNode, EvaluatedModules, FetchFunctionOptions, FetchResult, ModuleRunner, ModuleRunnerTransport, ssrDynamicImportKey, ssrExportAllKey, ssrImportKey, ssrImportMetaKey, ssrModuleExportsKey };
290
- export type { FetchFunction, HMRLogger, InterceptorOptions, ModuleEvaluator, ModuleRunnerContext, ModuleRunnerHmr, ModuleRunnerImportMeta, ModuleRunnerOptions, ResolvedResult, SSRImportMetadata };
304
+ //#endregion
305
+ //#region src/module-runner/createImportMeta.d.ts
306
+ declare function createDefaultImportMeta(modulePath: string): ModuleRunnerImportMeta;
307
+ /**
308
+ * Create import.meta object for Node.js.
309
+ */
310
+ declare function createNodeImportMeta(modulePath: string): Promise<ModuleRunnerImportMeta>;
311
+ //#endregion
312
+ export { ESModulesEvaluator, type EvaluatedModuleNode, EvaluatedModules, type FetchFunction, type FetchFunctionOptions, type FetchResult, type HMRLogger, type InterceptorOptions, type ModuleEvaluator, ModuleRunner, type ModuleRunnerContext, type ModuleRunnerHmr, type ModuleRunnerImportMeta, type ModuleRunnerOptions, type ModuleRunnerTransport, type ModuleRunnerTransportHandlers, type ResolvedResult, type SSRImportMetadata, createDefaultImportMeta, createNodeImportMeta, createWebSocketModuleRunnerTransport, normalizeModuleId, ssrDynamicImportKey, ssrExportAllKey, ssrExportNameKey, ssrImportKey, ssrImportMetaKey, ssrModuleExportsKey };