webpack 5.110.0 → 5.110.2
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/README.md +10 -17
- package/lib/ExportsInfo.js +10 -0
- package/lib/FileSystemInfo.js +17 -2
- package/lib/Generator.js +17 -0
- package/lib/NormalModule.js +3 -3
- package/lib/RuntimeTemplate.js +423 -430
- package/lib/asset/AssetBytesGenerator.js +1 -3
- package/lib/asset/AssetGenerator.js +1 -3
- package/lib/asset/AssetSourceGenerator.js +1 -3
- package/lib/config/defaults.js +6 -0
- package/lib/css/CssGenerator.js +1 -3
- package/lib/css/CssLoadingRuntimeModule.js +32 -13
- package/lib/css/CssModulesPlugin.js +9 -17
- package/lib/css/data.js +13 -3
- package/lib/css/syntax.js +78 -10
- package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +10 -4
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +2 -0
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +48 -3
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +83 -14
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +114 -0
- package/lib/dependencies/WorkerAndWorkletPlugin.js +1 -0
- package/lib/dependencies/WorkerDependency.js +6 -12
- package/lib/dependencies/WorkletDependency.js +7 -11
- package/lib/esm/ModuleChunkLoadingPlugin.js +6 -9
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +7 -1
- package/lib/html/HtmlGenerator.js +1 -1
- package/lib/html/HtmlModulesPlugin.js +55 -16
- package/lib/html/syntax.js +113 -26
- package/lib/javascript/JavascriptGenerator.js +1 -1
- package/lib/javascript/JavascriptModulesPlugin.js +3 -10
- package/lib/json/JsonGenerator.js +1 -1
- package/lib/loaders/LoaderRunner.js +33 -5
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +8 -15
- package/lib/optimize/ConcatenatedModule.js +8 -0
- package/lib/optimize/ConstExportsPlugin.js +5 -0
- package/lib/optimize/InlineExports.js +121 -0
- package/lib/optimize/RealContentHashPlugin.js +111 -35
- package/lib/prefetch/ResourceHintPlugin.js +6 -12
- package/lib/serialization/ObjectMiddleware.js +128 -108
- package/lib/typescript/TypeScriptPlugin.js +8 -10
- package/lib/util/SourceProcessor.js +24 -8
- package/lib/util/createMappings.js +25 -3
- package/lib/util/removeBOM.js +82 -1
- package/lib/wasm-async/AsyncWasmCompileRuntimeModule.js +5 -3
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +5 -3
- package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +3 -1
- package/lib/wasm-async/UniversalCompileAsyncWasmPlugin.js +7 -12
- package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +3 -1
- package/lib/web/FetchCompileAsyncWasmPlugin.js +10 -6
- package/lib/web/FetchCompileWasmPlugin.js +4 -2
- package/package.json +1 -1
- package/types.d.ts +77 -10
package/lib/util/removeBOM.js
CHANGED
|
@@ -5,12 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
+
const { decodeVLQ, encodeVLQ } = require("./createMappings");
|
|
9
|
+
|
|
10
|
+
/** @import { RawSourceMap } from "webpack-sources" */
|
|
11
|
+
/** @import { Result } from "../NormalModule" */
|
|
12
|
+
|
|
8
13
|
/**
|
|
9
14
|
* Returns result without BOM.
|
|
10
15
|
* @param {string | Buffer} strOrBuffer string or buffer
|
|
11
16
|
* @returns {string | Buffer} result without BOM
|
|
12
17
|
*/
|
|
13
|
-
|
|
18
|
+
const removeBOM = (strOrBuffer) => {
|
|
14
19
|
if (typeof strOrBuffer === "string" && strOrBuffer.charCodeAt(0) === 0xfeff) {
|
|
15
20
|
return strOrBuffer.slice(1);
|
|
16
21
|
} else if (
|
|
@@ -24,3 +29,79 @@ module.exports = (strOrBuffer) => {
|
|
|
24
29
|
|
|
25
30
|
return strOrBuffer;
|
|
26
31
|
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A BOM occupies generated column 0 of the first line, so a map describing
|
|
35
|
+
* BOM-prefixed content starts that line at column 1 or later. Removing the BOM
|
|
36
|
+
* moves the line one column left; the segments after the first are encoded
|
|
37
|
+
* relative to it, so only the first is rewritten. A map already starting at
|
|
38
|
+
* column 0 describes the content without its BOM and is left alone.
|
|
39
|
+
* @param {string} mappings VLQ encoded `mappings` of a map for BOM-prefixed content
|
|
40
|
+
* @returns {string} `mappings` for the same content without its BOM
|
|
41
|
+
*/
|
|
42
|
+
const shiftMappings = (mappings) => {
|
|
43
|
+
const { value, end } = decodeVLQ(mappings, 0);
|
|
44
|
+
if (end === 0 || value <= 0) return mappings;
|
|
45
|
+
return encodeVLQ(value - 1) + mappings.slice(end);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Adjust a source map that accompanied BOM-prefixed content for the removal of
|
|
50
|
+
* that BOM. Anything without VLQ `mappings` is passed through untouched, as is
|
|
51
|
+
* a map declaring a version other than 3 — earlier versions spell `mappings`
|
|
52
|
+
* differently. A map that declares no version at all is taken as version 3.
|
|
53
|
+
* @param {(string | RawSourceMap)=} sourceMap the map, as an object or as JSON
|
|
54
|
+
* @returns {(string | RawSourceMap)=} the adjusted map
|
|
55
|
+
*/
|
|
56
|
+
const adjustSourceMapForRemovedBOM = (sourceMap) => {
|
|
57
|
+
if (!sourceMap) return sourceMap;
|
|
58
|
+
|
|
59
|
+
if (typeof sourceMap === "string") {
|
|
60
|
+
/** @type {RawSourceMap} */
|
|
61
|
+
let parsed;
|
|
62
|
+
try {
|
|
63
|
+
parsed = JSON.parse(sourceMap);
|
|
64
|
+
} catch (_err) {
|
|
65
|
+
return sourceMap;
|
|
66
|
+
}
|
|
67
|
+
const adjusted = adjustSourceMapForRemovedBOM(parsed);
|
|
68
|
+
return adjusted === parsed ? sourceMap : JSON.stringify(adjusted);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (sourceMap.version !== undefined && sourceMap.version !== 3) {
|
|
72
|
+
return sourceMap;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (typeof sourceMap.mappings !== "string") return sourceMap;
|
|
76
|
+
|
|
77
|
+
const mappings = shiftMappings(sourceMap.mappings);
|
|
78
|
+
|
|
79
|
+
return mappings === sourceMap.mappings
|
|
80
|
+
? sourceMap
|
|
81
|
+
: { ...sourceMap, mappings };
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @param {Result} result a loader result: content, an optional source map, extra info
|
|
86
|
+
* @returns {Result} the result with a leading BOM removed from its content and its source map kept in sync
|
|
87
|
+
*/
|
|
88
|
+
const removeBOMFromResult = (result) => {
|
|
89
|
+
const content = result[0];
|
|
90
|
+
const withoutBOM = removeBOM(content);
|
|
91
|
+
|
|
92
|
+
if (withoutBOM === content) return result;
|
|
93
|
+
|
|
94
|
+
// Copied rather than rebuilt, so a result carrying no source map keeps its
|
|
95
|
+
// arity.
|
|
96
|
+
const adjusted = /** @type {Result} */ ([...result]);
|
|
97
|
+
|
|
98
|
+
adjusted[0] = withoutBOM;
|
|
99
|
+
|
|
100
|
+
if (adjusted[1]) adjusted[1] = adjustSourceMapForRemovedBOM(adjusted[1]);
|
|
101
|
+
|
|
102
|
+
return adjusted;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
module.exports.adjustSourceMapForRemovedBOM = adjustSourceMapForRemovedBOM;
|
|
106
|
+
module.exports.removeBOM = removeBOM;
|
|
107
|
+
module.exports.removeBOMFromResult = removeBOMFromResult;
|
|
@@ -11,11 +11,12 @@ const Template = require("../Template");
|
|
|
11
11
|
const { fullHashPathData } = require("../wasm/wasmModuleFilename");
|
|
12
12
|
|
|
13
13
|
/** @import Chunk from "../Chunk" */
|
|
14
|
+
/** @import ChunkGraph from "../ChunkGraph" */
|
|
14
15
|
/** @import Compilation from "../Compilation" */
|
|
15
16
|
/** @import { RuntimeSpec } from "../util/runtime" */
|
|
16
17
|
|
|
17
18
|
/** @typedef {(wasmModuleSrcPath: string) => string} GenerateBeforeLoadBinaryCode */
|
|
18
|
-
/** @typedef {(wasmModuleSrcPath: string, runtime: RuntimeSpec) => string} GenerateLoadBinaryCode */
|
|
19
|
+
/** @typedef {(wasmModuleSrcPath: string, runtime: RuntimeSpec, analyzable: boolean) => string} GenerateLoadBinaryCode */
|
|
19
20
|
/** @typedef {() => string} GenerateBeforeCompileStreaming */
|
|
20
21
|
|
|
21
22
|
/**
|
|
@@ -69,7 +70,7 @@ class AsyncWasmCompileRuntimeModule extends RuntimeModule {
|
|
|
69
70
|
// Analyzable output bakes the binary's URL into the call site instead.
|
|
70
71
|
const analyzable = runtimeTemplate.supportsAnalyzable(
|
|
71
72
|
"wasm",
|
|
72
|
-
|
|
73
|
+
/** @type {ChunkGraph} */ (this.chunkGraph),
|
|
73
74
|
undefined,
|
|
74
75
|
chunk.runtime
|
|
75
76
|
);
|
|
@@ -92,7 +93,8 @@ class AsyncWasmCompileRuntimeModule extends RuntimeModule {
|
|
|
92
93
|
|
|
93
94
|
const loader = this.generateLoadBinaryCode(
|
|
94
95
|
wasmModuleSrcPath,
|
|
95
|
-
chunk.runtime
|
|
96
|
+
chunk.runtime,
|
|
97
|
+
analyzable
|
|
96
98
|
);
|
|
97
99
|
|
|
98
100
|
// Fallback path: fetch -> arrayBuffer -> WebAssembly.compile
|
|
@@ -11,11 +11,12 @@ const Template = require("../Template");
|
|
|
11
11
|
const { fullHashPathData } = require("../wasm/wasmModuleFilename");
|
|
12
12
|
|
|
13
13
|
/** @import Chunk from "../Chunk" */
|
|
14
|
+
/** @import ChunkGraph from "../ChunkGraph" */
|
|
14
15
|
/** @import Compilation from "../Compilation" */
|
|
15
16
|
/** @import { RuntimeSpec } from "../util/runtime" */
|
|
16
17
|
|
|
17
18
|
/** @typedef {(wasmModuleSrcPath: string) => string} GenerateBeforeLoadBinaryCode */
|
|
18
|
-
/** @typedef {(wasmModuleSrcPath: string, runtime: RuntimeSpec) => string} GenerateLoadBinaryCode */
|
|
19
|
+
/** @typedef {(wasmModuleSrcPath: string, runtime: RuntimeSpec, analyzable: boolean) => string} GenerateLoadBinaryCode */
|
|
19
20
|
/** @typedef {() => string} GenerateBeforeInstantiateStreaming */
|
|
20
21
|
|
|
21
22
|
/**
|
|
@@ -70,7 +71,7 @@ class AsyncWasmLoadingRuntimeModule extends RuntimeModule {
|
|
|
70
71
|
// Analyzable output bakes the binary's URL into the call site instead.
|
|
71
72
|
const analyzable = runtimeTemplate.supportsAnalyzable(
|
|
72
73
|
"wasm",
|
|
73
|
-
|
|
74
|
+
/** @type {ChunkGraph} */ (this.chunkGraph),
|
|
74
75
|
undefined,
|
|
75
76
|
chunk.runtime
|
|
76
77
|
);
|
|
@@ -93,7 +94,8 @@ class AsyncWasmLoadingRuntimeModule extends RuntimeModule {
|
|
|
93
94
|
|
|
94
95
|
const loader = this.generateLoadBinaryCode(
|
|
95
96
|
wasmModuleSrcPath,
|
|
96
|
-
chunk.runtime
|
|
97
|
+
chunk.runtime,
|
|
98
|
+
analyzable
|
|
97
99
|
);
|
|
98
100
|
const fallback = [
|
|
99
101
|
`.then(${runtimeTemplate.returningFunction("x.arrayBuffer()", "x")})`,
|
|
@@ -302,7 +302,9 @@ class AsyncWebAssemblyJavascriptGenerator extends Generator {
|
|
|
302
302
|
* @returns {Source | null} generated code
|
|
303
303
|
*/
|
|
304
304
|
generateError(error, module, generateContext) {
|
|
305
|
-
return new RawSource(
|
|
305
|
+
return new RawSource(
|
|
306
|
+
Generator.throwBuildErrorCode(error, "WebAssembly.CompileError")
|
|
307
|
+
);
|
|
306
308
|
}
|
|
307
309
|
}
|
|
308
310
|
|
|
@@ -67,31 +67,26 @@ class UniversalCompileAsyncWasmPlugin {
|
|
|
67
67
|
// per call: it depends on parse results, so it is not settled while the plugin
|
|
68
68
|
// is being applied.
|
|
69
69
|
/**
|
|
70
|
-
* @param {
|
|
70
|
+
* @param {boolean} analyzable whether the call site bakes a complete URL
|
|
71
71
|
* @returns {string} the argument to hand the reader
|
|
72
72
|
*/
|
|
73
|
-
const wasmUrlArg = (
|
|
74
|
-
|
|
75
|
-
"wasm",
|
|
76
|
-
undefined,
|
|
77
|
-
undefined,
|
|
78
|
-
runtime
|
|
79
|
-
)
|
|
73
|
+
const wasmUrlArg = (analyzable) =>
|
|
74
|
+
analyzable
|
|
80
75
|
? "wasmUrl"
|
|
81
76
|
: compilation.runtimeTemplate.importMetaUrl("wasmUrl");
|
|
82
77
|
/**
|
|
83
78
|
* Generates the runtime expression that fetches the binary in browsers
|
|
84
79
|
* or reads it from the filesystem in Node.js.
|
|
85
|
-
* @type {(path: string, runtime: RuntimeSpec) => string}
|
|
80
|
+
* @type {(path: string, runtime: RuntimeSpec, analyzable: boolean) => string}
|
|
86
81
|
*/
|
|
87
|
-
const generateLoadBinaryCode = (path, runtime) =>
|
|
82
|
+
const generateLoadBinaryCode = (path, runtime, analyzable) =>
|
|
88
83
|
Template.asString([
|
|
89
84
|
"(useFetch",
|
|
90
|
-
Template.indent([`? fetch(${wasmUrlArg(
|
|
85
|
+
Template.indent([`? fetch(${wasmUrlArg(analyzable)})`]),
|
|
91
86
|
Template.indent([
|
|
92
87
|
": Promise.all([import('fs'), import('url')]).then(([{ readFile }, { URL }]) => new Promise((resolve, reject) => {",
|
|
93
88
|
Template.indent([
|
|
94
|
-
`readFile(${wasmUrlArg(
|
|
89
|
+
`readFile(${wasmUrlArg(analyzable)}, (err, buffer) => {`,
|
|
95
90
|
Template.indent([
|
|
96
91
|
"if (err) return reject(err);",
|
|
97
92
|
"",
|
|
@@ -231,7 +231,9 @@ class WebAssemblyJavascriptGenerator extends Generator {
|
|
|
231
231
|
* @returns {Source | null} generated code
|
|
232
232
|
*/
|
|
233
233
|
generateError(error, module, generateContext) {
|
|
234
|
-
return new RawSource(
|
|
234
|
+
return new RawSource(
|
|
235
|
+
Generator.throwBuildErrorCode(error, "WebAssembly.CompileError")
|
|
236
|
+
);
|
|
235
237
|
}
|
|
236
238
|
}
|
|
237
239
|
|
|
@@ -91,12 +91,14 @@ class FetchCompileAsyncWasmPlugin {
|
|
|
91
91
|
}
|
|
92
92
|
const baked = compilation.runtimeTemplate.supportsAnalyzable(
|
|
93
93
|
"wasm",
|
|
94
|
-
|
|
94
|
+
chunkGraph,
|
|
95
95
|
undefined,
|
|
96
96
|
chunk.runtime
|
|
97
97
|
);
|
|
98
|
-
const analyzable =
|
|
99
|
-
|
|
98
|
+
const analyzable = compilation.runtimeTemplate.supportsAnalyzable(
|
|
99
|
+
"wasm-relative",
|
|
100
|
+
chunkGraph
|
|
101
|
+
);
|
|
100
102
|
// A baked URL carries the public path already, and a settled one is written
|
|
101
103
|
// out below; only a path nothing but the global knows asks for it.
|
|
102
104
|
const constant =
|
|
@@ -151,12 +153,14 @@ class FetchCompileAsyncWasmPlugin {
|
|
|
151
153
|
}
|
|
152
154
|
const baked = compilation.runtimeTemplate.supportsAnalyzable(
|
|
153
155
|
"wasm",
|
|
154
|
-
|
|
156
|
+
chunkGraph,
|
|
155
157
|
undefined,
|
|
156
158
|
chunk.runtime
|
|
157
159
|
);
|
|
158
|
-
const analyzable =
|
|
159
|
-
|
|
160
|
+
const analyzable = compilation.runtimeTemplate.supportsAnalyzable(
|
|
161
|
+
"wasm-relative",
|
|
162
|
+
chunkGraph
|
|
163
|
+
);
|
|
160
164
|
// A baked URL carries the public path already, and a settled one is written
|
|
161
165
|
// out below; only a path nothing but the global knows asks for it.
|
|
162
166
|
const constant =
|
|
@@ -99,8 +99,10 @@ class FetchCompileWasmPlugin {
|
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
set.add(RuntimeGlobals.moduleCache);
|
|
102
|
-
const analyzable =
|
|
103
|
-
|
|
102
|
+
const analyzable = compilation.runtimeTemplate.supportsAnalyzable(
|
|
103
|
+
"wasm-relative",
|
|
104
|
+
chunkGraph
|
|
105
|
+
);
|
|
104
106
|
const constant = analyzable
|
|
105
107
|
? undefined
|
|
106
108
|
: compilation.runtimeTemplate.constantPublicPath();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpack",
|
|
3
|
-
"version": "5.110.
|
|
3
|
+
"version": "5.110.2",
|
|
4
4
|
"description": "Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
|
|
5
5
|
"homepage": "https://github.com/webpack/webpack",
|
|
6
6
|
"bugs": "https://github.com/webpack/webpack/issues",
|
package/types.d.ts
CHANGED
|
@@ -355,6 +355,18 @@ declare interface AllCodeGenerationSchemas {
|
|
|
355
355
|
*/
|
|
356
356
|
"share-init": [{ shareScope: string; initStage: number; init: string }];
|
|
357
357
|
}
|
|
358
|
+
declare interface AnalyzableChunkUrls {
|
|
359
|
+
/**
|
|
360
|
+
* the urls that could be written, by chunk id
|
|
361
|
+
*/
|
|
362
|
+
urls: Map<ChunkId, string>;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* false when some chunk kept the runtime form, whose
|
|
366
|
+
* ids the consumer then still resolves through the runtime name lookup
|
|
367
|
+
*/
|
|
368
|
+
complete: boolean;
|
|
369
|
+
}
|
|
358
370
|
type AnalyzableForm =
|
|
359
371
|
"import" | "url" | "url-runtime" | "url-inline" | "wasm" | "wasm-relative";
|
|
360
372
|
type AnyLoaderContext = NormalModuleLoaderContext<any> &
|
|
@@ -6108,13 +6120,14 @@ declare interface DefaultHandlerOptions {
|
|
|
6108
6120
|
estimatedTime?: boolean;
|
|
6109
6121
|
phaseTimings?: boolean;
|
|
6110
6122
|
}
|
|
6111
|
-
|
|
6112
|
-
declare interface DeferredEmbeddedSource {
|
|
6113
|
-
source: string;
|
|
6114
|
-
build: (answer?: string) => string;
|
|
6123
|
+
type DeferredEmbeddedSource = DeferredWrite & {
|
|
6115
6124
|
type: string;
|
|
6116
6125
|
hostType: string;
|
|
6117
6126
|
as?: string;
|
|
6127
|
+
};
|
|
6128
|
+
declare interface DeferredWrite {
|
|
6129
|
+
source: string;
|
|
6130
|
+
build: (answer?: string) => string;
|
|
6118
6131
|
}
|
|
6119
6132
|
type DefineConfigInput =
|
|
6120
6133
|
| Configuration
|
|
@@ -8130,6 +8143,12 @@ declare abstract class ExportInfo {
|
|
|
8130
8143
|
resolveTargetFilter?: (target: TargetItemWithConnection) => boolean
|
|
8131
8144
|
): undefined | TargetItemWithConnection;
|
|
8132
8145
|
|
|
8146
|
+
/**
|
|
8147
|
+
* Returns whether resolving the target leads back to this export, which
|
|
8148
|
+
* `getTarget` cannot express as it reports a cycle as "no target".
|
|
8149
|
+
*/
|
|
8150
|
+
hasCircularTarget(moduleGraph: ModuleGraph): boolean;
|
|
8151
|
+
|
|
8133
8152
|
/**
|
|
8134
8153
|
* Move the target forward as long resolveTargetFilter is fulfilled
|
|
8135
8154
|
*/
|
|
@@ -8169,6 +8188,7 @@ declare abstract class ExportMode {
|
|
|
8169
8188
|
items: null | NormalReexportItem[];
|
|
8170
8189
|
name: null | string;
|
|
8171
8190
|
partialNamespaceExportInfo: null | ExportInfo;
|
|
8191
|
+
circular: boolean;
|
|
8172
8192
|
ignored: null | Set<string>;
|
|
8173
8193
|
hidden?: null | Set<string>;
|
|
8174
8194
|
userRequest: null | string;
|
|
@@ -9482,6 +9502,14 @@ declare class Generator {
|
|
|
9482
9502
|
static byType(map: {
|
|
9483
9503
|
[index: string]: undefined | Generator;
|
|
9484
9504
|
}): ByTypeGenerator;
|
|
9505
|
+
|
|
9506
|
+
/**
|
|
9507
|
+
* Returns the statement a module that failed to build throws when executed.
|
|
9508
|
+
*/
|
|
9509
|
+
static throwBuildErrorCode(
|
|
9510
|
+
error: Error,
|
|
9511
|
+
parseErrorConstructor?: string
|
|
9512
|
+
): string;
|
|
9485
9513
|
}
|
|
9486
9514
|
declare interface GeneratorOptions {
|
|
9487
9515
|
[index: string]: any;
|
|
@@ -9884,6 +9912,9 @@ declare class HarmonyImportDependencyTemplate extends DependencyTemplate {
|
|
|
9884
9912
|
referencedModule: Module
|
|
9885
9913
|
): undefined | string | boolean | SortableSet<string>;
|
|
9886
9914
|
}
|
|
9915
|
+
declare abstract class HarmonyImportSideEffectDependency extends HarmonyImportDependency {
|
|
9916
|
+
unusedSpecifiers?: UnusedSpecifiers;
|
|
9917
|
+
}
|
|
9887
9918
|
declare interface HarmonySettings {
|
|
9888
9919
|
ids: string[];
|
|
9889
9920
|
source: string;
|
|
@@ -9892,6 +9923,16 @@ declare interface HarmonySettings {
|
|
|
9892
9923
|
await: boolean;
|
|
9893
9924
|
attributes?: ImportAttributes;
|
|
9894
9925
|
phase: ImportPhaseType;
|
|
9926
|
+
|
|
9927
|
+
/**
|
|
9928
|
+
* whether the binding is referenced anywhere
|
|
9929
|
+
*/
|
|
9930
|
+
used: boolean;
|
|
9931
|
+
|
|
9932
|
+
/**
|
|
9933
|
+
* the statement's own dependency
|
|
9934
|
+
*/
|
|
9935
|
+
dependency?: HarmonyImportSideEffectDependency;
|
|
9895
9936
|
}
|
|
9896
9937
|
declare abstract class HarmonyStarExportsList {
|
|
9897
9938
|
dependencies: HarmonyExportImportedSpecifierDependency[];
|
|
@@ -26081,10 +26122,24 @@ declare abstract class RuntimeTemplate {
|
|
|
26081
26122
|
*/
|
|
26082
26123
|
chunkRootOutputDir(chunk: Chunk, enforceRelative: boolean): string;
|
|
26083
26124
|
|
|
26125
|
+
/**
|
|
26126
|
+
* Static literal specifier (already quoted) for the `new URL(<here>, import.meta.url)`
|
|
26127
|
+
* a worker or worklet entry chunk bakes to, or `null` to keep the runtime form. The
|
|
26128
|
+
* gate and the build are asked together so every call site agrees on both — the
|
|
26129
|
+
* `new Worker(...)` emit, and the resource hint `ResourceHintPlugin` spells for it.
|
|
26130
|
+
*/
|
|
26131
|
+
getAnalyzableWorkerUrl(
|
|
26132
|
+
overridePublicPath: undefined | string,
|
|
26133
|
+
chunk: Chunk,
|
|
26134
|
+
module: Module,
|
|
26135
|
+
chunkGraph: ChunkGraph,
|
|
26136
|
+
runtimeRequirements: Set<string>
|
|
26137
|
+
): null | string;
|
|
26138
|
+
|
|
26084
26139
|
/**
|
|
26085
26140
|
* Static `new URL(<file>, import.meta.url)` for every stylesheet a runtime can load,
|
|
26086
|
-
* keyed by chunk id
|
|
26087
|
-
* `publicPath + getChunkCssFilename(id)` form. Both the runtime module reading them
|
|
26141
|
+
* keyed by chunk id — one that cannot be named leaves the map incomplete, and its
|
|
26142
|
+
* id keeps the runtime `publicPath + getChunkCssFilename(id)` form. Both the runtime module reading them
|
|
26088
26143
|
* and the plugin declaring what it needs ask this, so the two always agree. The
|
|
26089
26144
|
* runtime hands an absolute url string to `link.href`, and so does this — the browser
|
|
26090
26145
|
* resolves the element against the document, which is not where the chunk sits, and
|
|
@@ -26096,13 +26151,13 @@ declare abstract class RuntimeTemplate {
|
|
|
26096
26151
|
chunkGraph: ChunkGraph,
|
|
26097
26152
|
runtimeRequirements: ReadonlySet<string>,
|
|
26098
26153
|
consumingModule?: Module
|
|
26099
|
-
): null |
|
|
26154
|
+
): null | AnalyzableChunkUrls;
|
|
26100
26155
|
|
|
26101
26156
|
/**
|
|
26102
26157
|
* Static `new URL(<file>, import.meta.url).href` for every javascript chunk a
|
|
26103
26158
|
* runtime can hint at with `<link rel="prefetch"/"modulepreload">`, keyed by chunk
|
|
26104
|
-
* id
|
|
26105
|
-
* `publicPath + getChunkScriptFilename(id)` form. Both the runtime module reading
|
|
26159
|
+
* id — one that cannot be named leaves the map incomplete, and its id keeps the
|
|
26160
|
+
* runtime `publicPath + getChunkScriptFilename(id)` form. Both the runtime module reading
|
|
26106
26161
|
* them and the plugin declaring what it needs ask this, so the two always agree.
|
|
26107
26162
|
*/
|
|
26108
26163
|
analyzableChunkScriptUrls(
|
|
@@ -26110,7 +26165,7 @@ declare abstract class RuntimeTemplate {
|
|
|
26110
26165
|
chunkGraph: ChunkGraph,
|
|
26111
26166
|
runtimeRequirements: ReadonlySet<string>,
|
|
26112
26167
|
consumingModule?: Module
|
|
26113
|
-
): null |
|
|
26168
|
+
): null | AnalyzableChunkUrls;
|
|
26114
26169
|
|
|
26115
26170
|
/**
|
|
26116
26171
|
* Static `new URL(<file>, import.meta.url)` for the binary emitted for an async wasm
|
|
@@ -27148,6 +27203,10 @@ declare class SourceProcessorSyntaxClass_1 extends SourceProcessorClass<
|
|
|
27148
27203
|
> {
|
|
27149
27204
|
constructor();
|
|
27150
27205
|
static PrintContext: typeof PrintContext;
|
|
27206
|
+
static declineDeferredWrites: (
|
|
27207
|
+
text: string,
|
|
27208
|
+
writes: DeferredWrite[]
|
|
27209
|
+
) => string;
|
|
27151
27210
|
static deferredWrite: (id: number) => string;
|
|
27152
27211
|
}
|
|
27153
27212
|
|
|
@@ -27217,6 +27276,10 @@ declare class SourceProcessorSyntaxClass_2 extends SourceProcessorClass<
|
|
|
27217
27276
|
> {
|
|
27218
27277
|
constructor();
|
|
27219
27278
|
static PrintContext: typeof PrintContext;
|
|
27279
|
+
static declineDeferredWrites: (
|
|
27280
|
+
text: string,
|
|
27281
|
+
writes: DeferredWrite[]
|
|
27282
|
+
) => string;
|
|
27220
27283
|
static deferredWrite: (id: number) => string;
|
|
27221
27284
|
}
|
|
27222
27285
|
declare interface SourceTable {
|
|
@@ -28755,6 +28818,10 @@ declare interface TsconfigPathsMap {
|
|
|
28755
28818
|
declare const UNDEFINED_MARKER: unique symbol;
|
|
28756
28819
|
declare interface URL_url extends URL {}
|
|
28757
28820
|
type UnsafeCacheData = KnownUnsafeCacheData & Record<string, any>;
|
|
28821
|
+
declare interface UnusedSpecifiers {
|
|
28822
|
+
exportPresenceMode: ExportPresenceMode;
|
|
28823
|
+
specifiers: [string[], string][];
|
|
28824
|
+
}
|
|
28758
28825
|
declare interface UpdateHashContextDependency {
|
|
28759
28826
|
chunkGraph: ChunkGraph;
|
|
28760
28827
|
runtime: RuntimeSpec;
|