webpack 5.106.2 → 5.107.1
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 +2 -2
- package/lib/APIPlugin.js +1 -1
- package/lib/BannerPlugin.js +3 -4
- package/lib/Cache.js +3 -6
- package/lib/Chunk.js +21 -25
- package/lib/ChunkGroup.js +57 -15
- package/lib/CompatibilityPlugin.js +8 -7
- package/lib/Compilation.js +67 -37
- package/lib/Compiler.js +4 -13
- package/lib/ContextModule.js +2 -2
- package/lib/DefinePlugin.js +2 -2
- package/lib/Dependency.js +22 -1
- package/lib/DependencyTemplate.js +2 -1
- package/lib/EnvironmentPlugin.js +1 -1
- package/lib/EvalSourceMapDevToolPlugin.js +8 -10
- package/lib/ExportsInfo.js +30 -34
- package/lib/ExternalModule.js +91 -26
- package/lib/ExternalModuleFactoryPlugin.js +7 -1
- package/lib/FileSystemInfo.js +187 -72
- package/lib/Generator.js +3 -3
- package/lib/HotModuleReplacementPlugin.js +26 -8
- package/lib/IgnorePlugin.js +2 -1
- package/lib/Module.js +20 -19
- package/lib/ModuleFactory.js +1 -1
- package/lib/ModuleNotFoundError.js +3 -84
- package/lib/ModuleSourceTypeConstants.js +51 -19
- package/lib/ModuleTypeConstants.js +12 -3
- package/lib/MultiCompiler.js +2 -2
- package/lib/NodeStuffPlugin.js +1 -1
- package/lib/NormalModule.js +119 -77
- package/lib/NormalModuleFactory.js +47 -27
- package/lib/Parser.js +1 -1
- package/lib/ProgressPlugin.js +129 -56
- package/lib/RuntimeGlobals.js +5 -5
- package/lib/RuntimeModule.js +9 -7
- package/lib/RuntimePlugin.js +12 -1
- package/lib/SourceMapDevToolPlugin.js +250 -49
- package/lib/Template.js +1 -1
- package/lib/TemplatedPathPlugin.js +22 -4
- package/lib/WarnCaseSensitiveModulesPlugin.js +70 -2
- package/lib/WarnDeprecatedOptionPlugin.js +1 -1
- package/lib/WarnNoModeSetPlugin.js +16 -1
- package/lib/Watching.js +2 -3
- package/lib/WebpackError.js +3 -77
- package/lib/WebpackIsIncludedPlugin.js +1 -1
- package/lib/WebpackOptionsApply.js +13 -1
- package/lib/asset/AssetBytesGenerator.js +12 -8
- package/lib/asset/AssetGenerator.js +36 -22
- package/lib/asset/AssetModulesPlugin.js +6 -8
- package/lib/asset/AssetSourceGenerator.js +12 -8
- package/lib/buildChunkGraph.js +4 -6
- package/lib/cache/PackFileCacheStrategy.js +4 -4
- package/lib/cli.js +3 -1
- package/lib/config/defaults.js +197 -10
- package/lib/config/normalization.js +3 -1
- package/lib/css/CssGenerator.js +320 -105
- package/lib/css/CssInjectStyleRuntimeModule.js +44 -42
- package/lib/css/CssLoadingRuntimeModule.js +22 -4
- package/lib/{CssModule.js → css/CssModule.js} +15 -15
- package/lib/css/CssModulesPlugin.js +168 -88
- package/lib/css/CssParser.js +566 -269
- package/lib/css/walkCssTokens.js +148 -2
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +1 -1
- package/lib/dependencies/CommonJsDependencyHelpers.js +63 -0
- package/lib/dependencies/CommonJsExportRequireDependency.js +54 -10
- package/lib/dependencies/CommonJsExportsParserPlugin.js +1 -1
- package/lib/dependencies/CommonJsFullRequireDependency.js +32 -9
- package/lib/dependencies/CommonJsImportsParserPlugin.js +112 -4
- package/lib/dependencies/CommonJsRequireDependency.js +67 -4
- package/lib/dependencies/ContextDependency.js +1 -1
- package/lib/dependencies/ContextDependencyHelpers.js +1 -1
- package/lib/dependencies/CreateRequireParserPlugin.js +1 -1
- package/lib/dependencies/CriticalDependencyWarning.js +1 -1
- package/lib/dependencies/CssIcssExportDependency.js +332 -67
- package/lib/dependencies/CssIcssImportDependency.js +49 -7
- package/lib/dependencies/CssIcssSymbolDependency.js +11 -3
- package/lib/dependencies/CssImportDependency.js +8 -0
- package/lib/dependencies/CssUrlDependency.js +28 -2
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +22 -2
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +8 -7
- package/lib/dependencies/HarmonyExportExpressionDependency.js +22 -14
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +110 -3
- package/lib/dependencies/HarmonyImportDependency.js +10 -2
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +22 -1
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +1 -1
- package/lib/{HarmonyLinkingError.js → dependencies/HarmonyLinkingError.js} +5 -3
- package/lib/dependencies/HtmlInlineScriptDependency.js +133 -0
- package/lib/dependencies/HtmlInlineStyleDependency.js +101 -0
- package/lib/dependencies/HtmlScriptSrcDependency.js +557 -0
- package/lib/dependencies/HtmlSourceDependency.js +128 -0
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +1 -1
- package/lib/dependencies/ImportParserPlugin.js +2 -2
- package/lib/dependencies/ImportPhase.js +1 -1
- package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +1 -1
- package/lib/{RequireJsStuffPlugin.js → dependencies/RequireJsStuffPlugin.js} +7 -7
- package/lib/dependencies/SystemPlugin.js +1 -1
- package/lib/dependencies/WebAssemblyImportDependency.js +1 -1
- package/lib/dependencies/WorkerPlugin.js +2 -2
- package/lib/{DelegatedModule.js → dll/DelegatedModule.js} +31 -31
- package/lib/{DelegatedModuleFactoryPlugin.js → dll/DelegatedModuleFactoryPlugin.js} +4 -4
- package/lib/{DelegatedPlugin.js → dll/DelegatedPlugin.js} +2 -2
- package/lib/{DllEntryPlugin.js → dll/DllEntryPlugin.js} +4 -4
- package/lib/{DllModule.js → dll/DllModule.js} +24 -24
- package/lib/{DllModuleFactory.js → dll/DllModuleFactory.js} +4 -4
- package/lib/{DllPlugin.js → dll/DllPlugin.js} +6 -5
- package/lib/{DllReferencePlugin.js → dll/DllReferencePlugin.js} +14 -14
- package/lib/{LibManifestPlugin.js → dll/LibManifestPlugin.js} +9 -9
- package/lib/{AsyncDependencyToInitialChunkError.js → errors/AsyncDependencyToInitialChunkError.js} +2 -2
- package/lib/errors/BuildCycleError.js +1 -1
- package/lib/{ChunkRenderError.js → errors/ChunkRenderError.js} +1 -1
- package/lib/{CodeGenerationError.js → errors/CodeGenerationError.js} +1 -1
- package/lib/{CommentCompilationWarning.js → errors/CommentCompilationWarning.js} +3 -3
- package/lib/{ConcurrentCompilationError.js → errors/ConcurrentCompilationError.js} +4 -2
- package/lib/{EnvironmentNotSupportAsyncWarning.js → errors/EnvironmentNotSupportAsyncWarning.js} +4 -4
- package/lib/{HookWebpackError.js → errors/HookWebpackError.js} +5 -5
- package/lib/{IgnoreErrorModuleFactory.js → errors/IgnoreErrorModuleFactory.js} +4 -4
- package/lib/{InvalidDependenciesModuleWarning.js → errors/InvalidDependenciesModuleWarning.js} +3 -3
- package/lib/errors/JSONParseError.js +114 -0
- package/lib/{ModuleBuildError.js → errors/ModuleBuildError.js} +5 -5
- package/lib/{ModuleDependencyError.js → errors/ModuleDependencyError.js} +2 -2
- package/lib/{ModuleDependencyWarning.js → errors/ModuleDependencyWarning.js} +4 -4
- package/lib/{ModuleError.js → errors/ModuleError.js} +5 -5
- package/lib/{ModuleHashingError.js → errors/ModuleHashingError.js} +1 -1
- package/lib/errors/ModuleNotFoundError.js +91 -0
- package/lib/{ModuleParseError.js → errors/ModuleParseError.js} +8 -6
- package/lib/{ModuleRestoreError.js → errors/ModuleRestoreError.js} +1 -1
- package/lib/{ModuleStoreError.js → errors/ModuleStoreError.js} +1 -1
- package/lib/{ModuleWarning.js → errors/ModuleWarning.js} +5 -5
- package/lib/{NodeStuffInWebError.js → errors/NodeStuffInWebError.js} +4 -4
- package/lib/errors/NonErrorEmittedError.js +28 -0
- package/lib/{UnhandledSchemeError.js → errors/UnhandledSchemeError.js} +2 -2
- package/lib/{UnsupportedFeatureWarning.js → errors/UnsupportedFeatureWarning.js} +3 -3
- package/lib/errors/WebpackError.js +84 -0
- package/lib/html/HtmlGenerator.js +379 -0
- package/lib/html/HtmlModulesPlugin.js +429 -0
- package/lib/html/HtmlParser.js +1489 -0
- package/lib/html/walkHtmlTokens.js +3249 -0
- package/lib/ids/IdHelpers.js +2 -1
- package/lib/index.js +36 -15
- package/lib/javascript/JavascriptModulesPlugin.js +91 -10
- package/lib/javascript/JavascriptParser.js +197 -16
- package/lib/javascript/JavascriptParserHelpers.js +1 -1
- package/lib/json/JsonParser.js +7 -16
- package/lib/library/AbstractLibraryPlugin.js +1 -1
- package/lib/library/EnableLibraryPlugin.js +1 -1
- package/lib/{FalseIIFEUmdWarning.js → library/FalseIIFEUmdWarning.js} +1 -1
- package/lib/library/ModuleLibraryPlugin.js +74 -0
- package/lib/node/NodeEnvironmentPlugin.js +4 -2
- package/lib/node/nodeConsole.js +113 -64
- package/lib/optimize/ConcatenatedModule.js +51 -6
- package/lib/optimize/InnerGraph.js +1 -1
- package/lib/optimize/InnerGraphPlugin.js +11 -1
- package/lib/optimize/MinMaxSizeWarning.js +4 -4
- package/lib/optimize/ModuleConcatenationPlugin.js +15 -7
- package/lib/optimize/RealContentHashPlugin.js +89 -26
- package/lib/optimize/SideEffectsFlagPlugin.js +112 -5
- package/lib/optimize/SplitChunksPlugin.js +5 -5
- package/lib/performance/AssetsOverSizeLimitWarning.js +2 -2
- package/lib/performance/EntrypointsOverSizeLimitWarning.js +2 -2
- package/lib/performance/NoAsyncChunksWarning.js +5 -3
- package/lib/performance/SizeLimitsPlugin.js +1 -1
- package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +4 -1
- package/lib/rules/UseEffectRulePlugin.js +4 -3
- package/lib/runtime/AutoPublicPathRuntimeModule.js +3 -3
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +5 -5
- package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +119 -13
- package/lib/runtime/SetAnonymousDefaultNameRuntimeModule.js +35 -0
- package/lib/schemes/DataUriPlugin.js +13 -1
- package/lib/schemes/VirtualUrlPlugin.js +1 -1
- package/lib/serialization/SerializerMiddleware.js +2 -2
- package/lib/sharing/ConsumeSharedPlugin.js +4 -10
- package/lib/sharing/ConsumeSharedRuntimeModule.js +8 -4
- package/lib/sharing/ProvideSharedModule.js +1 -1
- package/lib/sharing/ProvideSharedPlugin.js +5 -5
- package/lib/sharing/resolveMatchedConfigs.js +1 -1
- package/lib/stats/DefaultStatsFactoryPlugin.js +2 -2
- package/lib/stats/DefaultStatsPresetPlugin.js +1 -1
- package/lib/stats/DefaultStatsPrinterPlugin.js +1 -1
- package/lib/stats/StatsFactory.js +1 -1
- package/lib/typescript/TypeScriptPlugin.js +210 -0
- package/lib/url/URLParserPlugin.js +2 -2
- package/lib/util/AsyncQueue.js +2 -2
- package/lib/util/Hash.js +2 -2
- package/lib/util/LocConverter.js +53 -0
- package/lib/util/SortableSet.js +1 -1
- package/lib/util/cleverMerge.js +2 -2
- package/lib/util/comparators.js +3 -3
- package/lib/util/concatenate.js +3 -3
- package/lib/util/conventions.js +42 -1
- package/lib/util/createMappings.js +118 -0
- package/lib/{formatLocation.js → util/formatLocation.js} +2 -2
- package/lib/{SizeFormatHelpers.js → util/formatSize.js} +3 -1
- package/lib/util/fs.js +8 -8
- package/lib/util/hash/md4.js +1 -1
- package/lib/util/hash/xxhash64.js +1 -1
- package/lib/util/identifier.js +48 -0
- package/lib/util/internalSerializables.js +35 -19
- package/lib/util/magicComment.js +10 -7
- package/lib/util/parseJson.js +2 -73
- package/lib/util/source.js +21 -0
- package/lib/util/topologicalSort.js +69 -0
- package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +3 -4
- package/lib/wasm-async/AsyncWebAssemblyParser.js +1 -1
- package/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js +5 -3
- package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +1 -1
- package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +5 -3
- package/lib/webpack.js +3 -1
- package/package.json +24 -22
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +129 -12
- package/schemas/plugins/{DllPlugin.check.d.ts → HtmlGeneratorOptions.check.d.ts} +1 -1
- package/schemas/plugins/HtmlGeneratorOptions.check.js +6 -0
- package/schemas/plugins/HtmlGeneratorOptions.json +3 -0
- package/schemas/plugins/ProgressPlugin.check.js +1 -1
- package/schemas/plugins/ProgressPlugin.json +22 -0
- package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
- package/schemas/plugins/container/ContainerReferencePlugin.json +1 -0
- package/schemas/plugins/container/ExternalsType.check.js +1 -1
- package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
- package/schemas/plugins/container/ModuleFederationPlugin.json +1 -0
- package/schemas/plugins/{DllReferencePlugin.check.d.ts → css/CssAutoOrModuleParserOptions.check.d.ts} +1 -1
- package/schemas/plugins/css/CssAutoOrModuleParserOptions.check.js +6 -0
- package/schemas/plugins/css/CssAutoOrModuleParserOptions.json +3 -0
- package/schemas/plugins/dll/DllPlugin.check.d.ts +7 -0
- package/schemas/plugins/dll/DllReferencePlugin.check.d.ts +7 -0
- package/types.d.ts +1153 -233
- package/lib/CaseSensitiveModulesWarning.js +0 -80
- package/lib/GraphHelpers.js +0 -49
- package/lib/NoModeWarning.js +0 -23
- package/lib/css/CssMergeStyleSheetsRuntimeModule.js +0 -57
- /package/lib/{AbstractMethodError.js → errors/AbstractMethodError.js} +0 -0
- /package/schemas/plugins/{DllPlugin.check.js → dll/DllPlugin.check.js} +0 -0
- /package/schemas/plugins/{DllPlugin.json → dll/DllPlugin.json} +0 -0
- /package/schemas/plugins/{DllReferencePlugin.check.js → dll/DllReferencePlugin.check.js} +0 -0
- /package/schemas/plugins/{DllReferencePlugin.json → dll/DllReferencePlugin.json} +0 -0
package/lib/util/identifier.js
CHANGED
|
@@ -479,9 +479,57 @@ const getUndoPath = (filename, outputPath, enforceRelative) => {
|
|
|
479
479
|
: append;
|
|
480
480
|
};
|
|
481
481
|
|
|
482
|
+
const HASH_REGEXP = /(?<!\0)#/g;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Escape `#` characters that appear inside a path request's directory portion
|
|
486
|
+
* with the `\0#` escape recognized by enhanced-resolve, so a project located at
|
|
487
|
+
* a path like `/home/user/proj#1/` (or `./proj#1/`) resolves correctly. Applies
|
|
488
|
+
* to absolute paths (Unix or Windows) and relative paths (starting with `./` or
|
|
489
|
+
* `../`). Only triggers when a query string is present, because that is the case
|
|
490
|
+
* where the resolver's parseIdentifier fails (without a `?`, the resolver
|
|
491
|
+
* handles directory `#` via its own fallback). A `#` after the last path
|
|
492
|
+
* separator is left alone so that explicit fragment requests like
|
|
493
|
+
* `/abs/path/file.js#fragment` still behave the same. Bare module specifiers
|
|
494
|
+
* are not touched. Already-escaped `\0#` sequences are preserved so the
|
|
495
|
+
* explicit opt-out remains stable.
|
|
496
|
+
* @param {string} request request to potentially escape
|
|
497
|
+
* @returns {string} request with directory `#` characters escaped
|
|
498
|
+
*/
|
|
499
|
+
const escapeHashInPathRequest = (request) => {
|
|
500
|
+
if (request.length === 0) return request;
|
|
501
|
+
const queryStart = request.indexOf("?");
|
|
502
|
+
if (queryStart < 0) return request;
|
|
503
|
+
const hashStart = request.indexOf("#");
|
|
504
|
+
if (hashStart < 0 || hashStart >= queryStart) return request;
|
|
505
|
+
const c0 = request.charCodeAt(0);
|
|
506
|
+
const isAbsolute =
|
|
507
|
+
c0 === 47 /* "/" */ || WINDOWS_ABS_PATH_REGEXP.test(request);
|
|
508
|
+
let isRelative = false;
|
|
509
|
+
if (!isAbsolute && c0 === 46 /* "." */) {
|
|
510
|
+
const c1 = request.charCodeAt(1);
|
|
511
|
+
if (c1 === 47 || c1 === 92 /* "/" or "\" */) {
|
|
512
|
+
isRelative = true;
|
|
513
|
+
} else if (c1 === 46 /* "." */) {
|
|
514
|
+
const c2 = request.charCodeAt(2);
|
|
515
|
+
if (c2 === 47 || c2 === 92) isRelative = true;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
if (!isAbsolute && !isRelative) return request;
|
|
519
|
+
const lastSep = Math.max(
|
|
520
|
+
request.lastIndexOf("/", queryStart - 1),
|
|
521
|
+
request.lastIndexOf("\\", queryStart - 1)
|
|
522
|
+
);
|
|
523
|
+
if (hashStart >= lastSep) return request;
|
|
524
|
+
const pathPart = request.slice(0, lastSep);
|
|
525
|
+
return pathPart.replace(HASH_REGEXP, "\0#") + request.slice(lastSep);
|
|
526
|
+
};
|
|
527
|
+
|
|
482
528
|
module.exports.absolutify = absolutify;
|
|
483
529
|
module.exports.contextify = contextify;
|
|
530
|
+
module.exports.escapeHashInPathRequest = escapeHashInPathRequest;
|
|
484
531
|
module.exports.getUndoPath = getUndoPath;
|
|
532
|
+
module.exports.makeCacheable = makeCacheable;
|
|
485
533
|
module.exports.makePathsAbsolute = makeCacheableWithContext(_makePathsAbsolute);
|
|
486
534
|
module.exports.makePathsRelative = makeCacheableWithContext(_makePathsRelative);
|
|
487
535
|
module.exports.parseResource = makeCacheable(_parseResource);
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
// to process this
|
|
13
13
|
module.exports = {
|
|
14
14
|
AsyncDependenciesBlock: () => require("../AsyncDependenciesBlock"),
|
|
15
|
-
CommentCompilationWarning: () => require("../CommentCompilationWarning"),
|
|
16
15
|
ContextModule: () => require("../ContextModule"),
|
|
17
16
|
"cache/PackFileCacheStrategy": () =>
|
|
18
17
|
require("../cache/PackFileCacheStrategy"),
|
|
@@ -109,6 +108,14 @@ module.exports = {
|
|
|
109
108
|
require("../dependencies/HarmonyImportSpecifierDependency"),
|
|
110
109
|
"dependencies/HarmonyEvaluatedImportSpecifierDependency": () =>
|
|
111
110
|
require("../dependencies/HarmonyEvaluatedImportSpecifierDependency"),
|
|
111
|
+
"dependencies/HtmlInlineScriptDependency": () =>
|
|
112
|
+
require("../dependencies/HtmlInlineScriptDependency"),
|
|
113
|
+
"dependencies/HtmlInlineStyleDependency": () =>
|
|
114
|
+
require("../dependencies/HtmlInlineStyleDependency"),
|
|
115
|
+
"dependencies/HtmlScriptSrcDependency": () =>
|
|
116
|
+
require("../dependencies/HtmlScriptSrcDependency"),
|
|
117
|
+
"dependencies/HtmlSourceDependency": () =>
|
|
118
|
+
require("../dependencies/HtmlSourceDependency"),
|
|
112
119
|
"dependencies/ImportContextDependency": () =>
|
|
113
120
|
require("../dependencies/ImportContextDependency"),
|
|
114
121
|
"dependencies/ImportDependency": () =>
|
|
@@ -179,23 +186,14 @@ module.exports = {
|
|
|
179
186
|
"json/JsonData": () => require("../json/JsonData"),
|
|
180
187
|
"optimize/ConcatenatedModule": () =>
|
|
181
188
|
require("../optimize/ConcatenatedModule"),
|
|
182
|
-
|
|
189
|
+
|
|
183
190
|
DependenciesBlock: () => require("../DependenciesBlock"),
|
|
184
|
-
DllModule: () => require("../DllModule"),
|
|
185
191
|
ExternalModule: () => require("../ExternalModule"),
|
|
186
192
|
FileSystemInfo: () => require("../FileSystemInfo"),
|
|
187
193
|
InitFragment: () => require("../InitFragment"),
|
|
188
|
-
InvalidDependenciesModuleWarning: () =>
|
|
189
|
-
require("../InvalidDependenciesModuleWarning"),
|
|
190
|
-
Module: () => require("../Module"),
|
|
191
|
-
ModuleBuildError: () => require("../ModuleBuildError"),
|
|
192
|
-
ModuleDependencyWarning: () => require("../ModuleDependencyWarning"),
|
|
193
|
-
ModuleError: () => require("../ModuleError"),
|
|
194
194
|
ModuleGraph: () => require("../ModuleGraph"),
|
|
195
|
-
ModuleParseError: () => require("../ModuleParseError"),
|
|
196
|
-
ModuleWarning: () => require("../ModuleWarning"),
|
|
197
195
|
NormalModule: () => require("../NormalModule"),
|
|
198
|
-
CssModule: () => require("../CssModule"),
|
|
196
|
+
CssModule: () => require("../css/CssModule"),
|
|
199
197
|
RawDataUrlModule: () => require("../asset/RawDataUrlModule"),
|
|
200
198
|
RawModule: () => require("../RawModule"),
|
|
201
199
|
"sharing/ConsumeSharedModule": () =>
|
|
@@ -208,14 +206,32 @@ module.exports = {
|
|
|
208
206
|
require("../sharing/ProvideSharedDependency"),
|
|
209
207
|
"sharing/ProvideForSharedDependency": () =>
|
|
210
208
|
require("../sharing/ProvideForSharedDependency"),
|
|
211
|
-
UnsupportedFeatureWarning: () => require("../UnsupportedFeatureWarning"),
|
|
212
|
-
"util/LazySet": () => require("../util/LazySet"),
|
|
213
|
-
UnhandledSchemeError: () => require("../UnhandledSchemeError"),
|
|
214
|
-
NodeStuffInWebError: () => require("../NodeStuffInWebError"),
|
|
215
|
-
EnvironmentNotSupportAsyncWarning: () =>
|
|
216
|
-
require("../EnvironmentNotSupportAsyncWarning"),
|
|
217
|
-
WebpackError: () => require("../WebpackError"),
|
|
218
209
|
|
|
210
|
+
"errors/WebpackError": () => require("../errors/WebpackError"),
|
|
211
|
+
"errors/InvalidDependenciesModuleWarning": () =>
|
|
212
|
+
require("../errors/InvalidDependenciesModuleWarning"),
|
|
213
|
+
"errors/Module": () => require("../Module"),
|
|
214
|
+
"errors/ModuleParseError": () => require("../errors/ModuleParseError"),
|
|
215
|
+
"errors/ModuleWarning": () => require("../errors/ModuleWarning"),
|
|
216
|
+
"errors/ModuleBuildError": () => require("../errors/ModuleBuildError"),
|
|
217
|
+
"errors/ModuleDependencyWarning": () =>
|
|
218
|
+
require("../errors/ModuleDependencyWarning"),
|
|
219
|
+
"errors/ModuleError": () => require("../errors/ModuleError"),
|
|
220
|
+
"errors/UnhandledSchemeError": () =>
|
|
221
|
+
require("../errors/UnhandledSchemeError"),
|
|
222
|
+
"errors/UnsupportedFeatureWarning": () =>
|
|
223
|
+
require("../errors/UnsupportedFeatureWarning"),
|
|
224
|
+
"errors/EnvironmentNotSupportAsyncWarning": () =>
|
|
225
|
+
require("../errors/EnvironmentNotSupportAsyncWarning"),
|
|
226
|
+
"errors/CommentCompilationWarning": () =>
|
|
227
|
+
require("../errors/CommentCompilationWarning"),
|
|
228
|
+
"errors/NodeStuffInWebError": () => require("../errors/NodeStuffInWebError"),
|
|
229
|
+
"errors/JSONParseError": () => require("../errors/JSONParseError"),
|
|
230
|
+
|
|
231
|
+
"dll/DelegatedModule": () => require("../dll/DelegatedModule"),
|
|
232
|
+
"dll/DllModule": () => require("../dll/DllModule"),
|
|
233
|
+
|
|
234
|
+
"util/LazySet": () => require("../util/LazySet"),
|
|
219
235
|
"util/registerExternalSerializer": () => {
|
|
220
236
|
// already registered
|
|
221
237
|
}
|
package/lib/util/magicComment.js
CHANGED
|
@@ -9,18 +9,21 @@ const memoize = require("./memoize");
|
|
|
9
9
|
|
|
10
10
|
const getVm = memoize(() => require("vm"));
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
module.exports.CompilerHintNotationRegExp = Object.freeze({
|
|
13
|
+
Pure: /^\s*(?:#|@)__PURE__\s*$/,
|
|
14
|
+
NoSideEffects: /^\s*[#@]__NO_SIDE_EFFECTS__\s*$/
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* regexp to match at least one "magic comment"
|
|
19
|
+
* @returns {import("vm").Context} magic comment context
|
|
20
|
+
*/
|
|
13
21
|
module.exports.createMagicCommentContext = () =>
|
|
14
22
|
getVm().createContext(undefined, {
|
|
15
23
|
name: "Webpack Magic Comment Parser",
|
|
16
24
|
codeGeneration: { strings: false, wasm: false }
|
|
17
25
|
});
|
|
26
|
+
|
|
18
27
|
module.exports.webpackCommentRegExp = new RegExp(
|
|
19
28
|
/(^|\W)webpack[A-Z][A-Za-z]+:/
|
|
20
29
|
);
|
|
21
|
-
|
|
22
|
-
// regexp to match at least one "magic comment"
|
|
23
|
-
/**
|
|
24
|
-
* Returns magic comment context.
|
|
25
|
-
* @returns {import("vm").Context} magic comment context
|
|
26
|
-
*/
|
package/lib/util/parseJson.js
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
"use strict";
|
|
6
6
|
|
|
7
|
+
const JSONParseError = require("../errors/JSONParseError");
|
|
8
|
+
|
|
7
9
|
/** @typedef {import("../util/fs").JsonValue} JsonValue */
|
|
8
10
|
|
|
9
11
|
// Inspired by https://github.com/npm/json-parse-even-better-errors
|
|
@@ -17,79 +19,6 @@
|
|
|
17
19
|
*/
|
|
18
20
|
const stripBOM = (txt) => String(txt).replace(/^\uFEFF/, "");
|
|
19
21
|
|
|
20
|
-
class JSONParseError extends SyntaxError {
|
|
21
|
-
/**
|
|
22
|
-
* @param {Error} err err
|
|
23
|
-
* @param {EXPECTED_ANY} raw raw
|
|
24
|
-
* @param {string} txt text
|
|
25
|
-
* @param {number=} context context
|
|
26
|
-
* @param {EXPECTED_FUNCTION=} caller caller
|
|
27
|
-
*/
|
|
28
|
-
constructor(err, raw, txt, context = 20, caller = parseJson) {
|
|
29
|
-
let originalMessage = err.message;
|
|
30
|
-
/** @type {string} */
|
|
31
|
-
let message;
|
|
32
|
-
/** @type {number} */
|
|
33
|
-
let position;
|
|
34
|
-
|
|
35
|
-
if (typeof raw !== "string") {
|
|
36
|
-
message = `Cannot parse ${Array.isArray(raw) && raw.length === 0 ? "an empty array" : String(raw)}`;
|
|
37
|
-
position = 0;
|
|
38
|
-
} else if (!txt) {
|
|
39
|
-
message = `${originalMessage} while parsing empty string`;
|
|
40
|
-
position = 0;
|
|
41
|
-
} else {
|
|
42
|
-
// Node 20 puts single quotes around the token and a comma after it
|
|
43
|
-
const UNEXPECTED_TOKEN = /^Unexpected token '?(.)'?(,)? /i;
|
|
44
|
-
const badTokenMatch = originalMessage.match(UNEXPECTED_TOKEN);
|
|
45
|
-
const badIndexMatch = originalMessage.match(/ position\s+(\d+)/i);
|
|
46
|
-
|
|
47
|
-
if (badTokenMatch) {
|
|
48
|
-
const h = badTokenMatch[1].charCodeAt(0).toString(16).toUpperCase();
|
|
49
|
-
const hex = `0x${h.length % 2 ? "0" : ""}${h}`;
|
|
50
|
-
|
|
51
|
-
originalMessage = originalMessage.replace(
|
|
52
|
-
UNEXPECTED_TOKEN,
|
|
53
|
-
`Unexpected token ${JSON.stringify(badTokenMatch[1])} (${hex})$2 `
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** @type {number | undefined} */
|
|
58
|
-
let errIdx;
|
|
59
|
-
|
|
60
|
-
if (badIndexMatch) {
|
|
61
|
-
errIdx = Number(badIndexMatch[1]);
|
|
62
|
-
} else if (
|
|
63
|
-
// doesn't happen in Node 22+
|
|
64
|
-
/^Unexpected end of JSON.*/i.test(originalMessage)
|
|
65
|
-
) {
|
|
66
|
-
errIdx = txt.length - 1;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (errIdx === undefined) {
|
|
70
|
-
message = `${originalMessage} while parsing '${txt.slice(0, context * 2)}'`;
|
|
71
|
-
position = 0;
|
|
72
|
-
} else {
|
|
73
|
-
const start = errIdx <= context ? 0 : errIdx - context;
|
|
74
|
-
const end =
|
|
75
|
-
errIdx + context >= txt.length ? txt.length : errIdx + context;
|
|
76
|
-
const slice = `${start ? "..." : ""}${txt.slice(start, end)}${end === txt.length ? "" : "..."}`;
|
|
77
|
-
|
|
78
|
-
message = `${originalMessage} while parsing ${txt === slice ? "" : "near "}${JSON.stringify(slice)}`;
|
|
79
|
-
position = errIdx;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
super(message);
|
|
84
|
-
|
|
85
|
-
this.name = "JSONParseError";
|
|
86
|
-
this.systemError = err;
|
|
87
|
-
this.position = position;
|
|
88
|
-
|
|
89
|
-
Error.captureStackTrace(this, caller || this.constructor);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
22
|
/**
|
|
94
23
|
* @template [R=JsonValue]
|
|
95
24
|
* @callback ParseJsonFn
|
package/lib/util/source.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
8
|
/** @typedef {import("webpack-sources").Source} Source */
|
|
9
|
+
/** @typedef {import("./Hash")} Hash */
|
|
9
10
|
|
|
10
11
|
/** @type {WeakMap<Source, WeakMap<Source, boolean>>} */
|
|
11
12
|
const equalityCache = new WeakMap();
|
|
@@ -61,4 +62,24 @@ const isSourceEqual = (a, b) => {
|
|
|
61
62
|
return result;
|
|
62
63
|
};
|
|
63
64
|
|
|
65
|
+
// TODO remove in webpack 6, this is protection against authors who directly use `webpack-sources` outdated version
|
|
66
|
+
/**
|
|
67
|
+
* Feeds the Source's content into a Hash without forcing a single
|
|
68
|
+
* concatenated Buffer. Uses webpack-sources >= 3.4.0 `buffers()` when
|
|
69
|
+
* available so `ConcatSource` can stream its children directly.
|
|
70
|
+
* @param {Hash} hash hash to update
|
|
71
|
+
* @param {Source} source source whose bytes are appended
|
|
72
|
+
* @returns {void}
|
|
73
|
+
*/
|
|
74
|
+
const updateHashFromSource = (hash, source) => {
|
|
75
|
+
// TODO webpack 6: drop the `buffers` check, require webpack-sources >= 3.4
|
|
76
|
+
// and call `source.buffers()` unconditionally.
|
|
77
|
+
if (typeof source.buffers === "function") {
|
|
78
|
+
for (const buf of source.buffers()) hash.update(buf);
|
|
79
|
+
} else {
|
|
80
|
+
hash.update(source.buffer());
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
64
84
|
module.exports.isSourceEqual = isSourceEqual;
|
|
85
|
+
module.exports.updateHashFromSource = updateHashFromSource;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Topologically sort `nodes` using Kahn's algorithm with source-order
|
|
9
|
+
* tie-breaking. Nodes that participate in a cycle remain unvisited —
|
|
10
|
+
* `visit` is never called for them — so the caller can naturally keep
|
|
11
|
+
* them in their original position by treating "no visit" as "keep
|
|
12
|
+
* source order".
|
|
13
|
+
*
|
|
14
|
+
* Precondition: every node appearing in `graph` (as a key OR inside any
|
|
15
|
+
* successor set) must also appear in `nodes`. The caller owns this
|
|
16
|
+
* invariant; the function does not validate it.
|
|
17
|
+
*
|
|
18
|
+
* Complexity: O(V·(V + E)). Each outer iteration scans the ready set
|
|
19
|
+
* linearly to find the smallest source-index node. CSS composes graphs
|
|
20
|
+
* are small (a handful of files per module) so this is fine; if a much
|
|
21
|
+
* larger graph ever needs sorting here, swap in a min-heap.
|
|
22
|
+
* @template T
|
|
23
|
+
* @param {Map<T, Set<T>>} graph adjacency list (`a -> b` means `a` must come before `b`)
|
|
24
|
+
* @param {T[]} nodes nodes in source first-appearance order
|
|
25
|
+
* @param {(node: T, index: number) => void} visit called once per non-cyclic node in topological order
|
|
26
|
+
* @returns {void}
|
|
27
|
+
*/
|
|
28
|
+
module.exports = (graph, nodes, visit) => {
|
|
29
|
+
/** @type {Map<T, number>} */
|
|
30
|
+
const inDegree = new Map();
|
|
31
|
+
/** @type {Map<T, number>} */
|
|
32
|
+
const sourceIndex = new Map();
|
|
33
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
34
|
+
inDegree.set(nodes[i], 0);
|
|
35
|
+
sourceIndex.set(nodes[i], i);
|
|
36
|
+
}
|
|
37
|
+
for (const successors of graph.values()) {
|
|
38
|
+
for (const to of successors) {
|
|
39
|
+
inDegree.set(to, /** @type {number} */ (inDegree.get(to)) + 1);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const ready = nodes.filter((n) => inDegree.get(n) === 0);
|
|
44
|
+
let index = 0;
|
|
45
|
+
while (ready.length > 0) {
|
|
46
|
+
// Smallest-source-index wins ties. Linear scan + swap-with-last
|
|
47
|
+
// + pop avoids re-sorting the ready set on every iteration.
|
|
48
|
+
let minIdx = 0;
|
|
49
|
+
for (let i = 1; i < ready.length; i++) {
|
|
50
|
+
if (
|
|
51
|
+
/** @type {number} */ (sourceIndex.get(ready[i])) <
|
|
52
|
+
/** @type {number} */ (sourceIndex.get(ready[minIdx]))
|
|
53
|
+
) {
|
|
54
|
+
minIdx = i;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const node = ready[minIdx];
|
|
58
|
+
ready[minIdx] = ready[ready.length - 1];
|
|
59
|
+
ready.pop();
|
|
60
|
+
visit(node, index++);
|
|
61
|
+
const successors = graph.get(node);
|
|
62
|
+
if (!successors) continue;
|
|
63
|
+
for (const to of successors) {
|
|
64
|
+
const newDeg = /** @type {number} */ (inDegree.get(to)) - 1;
|
|
65
|
+
inDegree.set(to, newDeg);
|
|
66
|
+
if (newDeg === 0) ready.push(to);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
const { SyncWaterfallHook } = require("tapable");
|
|
9
9
|
const Compilation = require("../Compilation");
|
|
10
10
|
const Generator = require("../Generator");
|
|
11
|
-
const { tryRunOrWebpackError } = require("../HookWebpackError");
|
|
12
11
|
const { WEBASSEMBLY_MODULE_TYPE_ASYNC } = require("../ModuleTypeConstants");
|
|
13
12
|
const NormalModule = require("../NormalModule");
|
|
14
13
|
const WebAssemblyImportDependency = require("../dependencies/WebAssemblyImportDependency");
|
|
14
|
+
const { tryRunOrWebpackError } = require("../errors/HookWebpackError");
|
|
15
15
|
const { compareModulesByFullName } = require("../util/comparators");
|
|
16
16
|
const makeSerializable = require("../util/makeSerializable");
|
|
17
17
|
const memoize = require("../util/memoize");
|
|
@@ -27,7 +27,7 @@ const memoize = require("../util/memoize");
|
|
|
27
27
|
/** @typedef {import("../NormalModule").NormalModuleCreateData} NormalModuleCreateData */
|
|
28
28
|
/** @typedef {import("../ModuleGraph")} ModuleGraph */
|
|
29
29
|
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
|
|
30
|
-
/** @typedef {import("../WebpackError")} WebpackError */
|
|
30
|
+
/** @typedef {import("../errors/WebpackError")} WebpackError */
|
|
31
31
|
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
|
|
32
32
|
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
|
|
33
33
|
|
|
@@ -216,8 +216,7 @@ class AsyncWebAssemblyModulesPlugin {
|
|
|
216
216
|
PLUGIN_NAME,
|
|
217
217
|
(createData, resolveData) =>
|
|
218
218
|
new AsyncWasmModule({
|
|
219
|
-
|
|
220
|
-
(createData),
|
|
219
|
+
...createData,
|
|
221
220
|
phase: resolveData.phase
|
|
222
221
|
})
|
|
223
222
|
);
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
const t = require("@webassemblyjs/ast");
|
|
9
9
|
const { decode } = require("@webassemblyjs/wasm-parser");
|
|
10
|
-
const EnvironmentNotSupportAsyncWarning = require("../EnvironmentNotSupportAsyncWarning");
|
|
11
10
|
const Parser = require("../Parser");
|
|
12
11
|
const StaticExportsDependency = require("../dependencies/StaticExportsDependency");
|
|
13
12
|
const WebAssemblyImportDependency = require("../dependencies/WebAssemblyImportDependency");
|
|
13
|
+
const EnvironmentNotSupportAsyncWarning = require("../errors/EnvironmentNotSupportAsyncWarning");
|
|
14
14
|
|
|
15
15
|
/** @typedef {import("./AsyncWebAssemblyModulesPlugin").AsyncWasmModuleClass} AsyncWasmModule */
|
|
16
16
|
/** @typedef {import("../Module").BuildInfo} BuildInfo */
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
"use strict";
|
|
6
6
|
|
|
7
|
-
const WebpackError = require("../WebpackError");
|
|
7
|
+
const WebpackError = require("../errors/WebpackError");
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
class UnsupportedWebAssemblyFeatureError extends WebpackError {
|
|
10
10
|
/**
|
|
11
11
|
* Creates an instance of UnsupportedWebAssemblyFeatureError.
|
|
12
12
|
* @param {string} message Error message
|
|
@@ -18,4 +18,6 @@ module.exports = class UnsupportedWebAssemblyFeatureError extends WebpackError {
|
|
|
18
18
|
this.name = "UnsupportedWebAssemblyFeatureError";
|
|
19
19
|
this.hideStack = true;
|
|
20
20
|
}
|
|
21
|
-
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
module.exports = UnsupportedWebAssemblyFeatureError;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
const formatLocation = require("../formatLocation");
|
|
8
|
+
const formatLocation = require("../util/formatLocation");
|
|
9
9
|
const UnsupportedWebAssemblyFeatureError = require("./UnsupportedWebAssemblyFeatureError");
|
|
10
10
|
|
|
11
11
|
/** @typedef {import("../Compiler")} Compiler */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
"use strict";
|
|
6
6
|
|
|
7
|
-
const WebpackError = require("../WebpackError");
|
|
7
|
+
const WebpackError = require("../errors/WebpackError");
|
|
8
8
|
|
|
9
9
|
/** @typedef {import("../ChunkGraph")} ChunkGraph */
|
|
10
10
|
/** @typedef {import("../Module")} Module */
|
|
@@ -83,7 +83,7 @@ const getInitialModuleChains = (
|
|
|
83
83
|
return [...results];
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
class WebAssemblyInInitialChunkError extends WebpackError {
|
|
87
87
|
/**
|
|
88
88
|
* Creates an instance of WebAssemblyInInitialChunkError.
|
|
89
89
|
* @param {Module} module WASM module
|
|
@@ -110,4 +110,6 @@ ${moduleChains.map((s) => `* ${s}`).join("\n")}`;
|
|
|
110
110
|
this.hideStack = true;
|
|
111
111
|
this.module = module;
|
|
112
112
|
}
|
|
113
|
-
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
module.exports = WebAssemblyInInitialChunkError;
|
package/lib/webpack.js
CHANGED
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
const util = require("util");
|
|
9
9
|
const webpackOptionsSchemaCheck = require("../schemas/WebpackOptions.check");
|
|
10
|
-
const webpackOptionsSchema =
|
|
10
|
+
const webpackOptionsSchema =
|
|
11
|
+
/** @type {EXPECTED_ANY} */
|
|
12
|
+
(require("../schemas/WebpackOptions.json"));
|
|
11
13
|
const Compiler = require("./Compiler");
|
|
12
14
|
const MultiCompiler = require("./MultiCompiler");
|
|
13
15
|
const WebpackOptionsApply = require("./WebpackOptionsApply");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpack",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.107.1",
|
|
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",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"prelint": "yarn setup",
|
|
35
35
|
"lint": "yarn lint:code && yarn lint:special && yarn lint:types && yarn lint:types-test && yarn lint:types-benchmark && yarn lint:types-module-test && yarn lint:types-hot && yarn fmt:check && yarn lint:spellcheck",
|
|
36
36
|
"lint:code": "node node_modules/eslint/bin/eslint.js --cache .",
|
|
37
|
-
"lint:special": "node node_modules/tooling/lockfile-lint && node node_modules/tooling/schemas-lint && node node_modules/tooling/inherit-types && node node_modules/tooling/format-schemas && node tooling/generate-runtime-code.js && node tooling/generate-wasm-code.js && node node_modules/tooling/compile-to-definitions && node node_modules/tooling/precompile-schemas && node node_modules/tooling/generate-types --no-template-literals",
|
|
37
|
+
"lint:special": "node node_modules/tooling/lockfile-lint && node node_modules/tooling/schemas-lint && node node_modules/tooling/inherit-types && node node_modules/tooling/format-schemas && node tooling/generate-runtime-code.js && node tooling/generate-wasm-code.js && node tooling/generate-html-entities.js && node node_modules/tooling/compile-to-definitions && node node_modules/tooling/precompile-schemas && node node_modules/tooling/generate-types --no-template-literals",
|
|
38
38
|
"lint:types": "tsc",
|
|
39
39
|
"lint:types-test": "tsc -p tsconfig.types.test.json",
|
|
40
40
|
"lint:types-benchmark": "tsc -p tsconfig.types.benchmark.json",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"fmt:base": "node node_modules/prettier/bin/prettier.cjs --cache --ignore-unknown .",
|
|
49
49
|
"fix": "yarn fix:code && yarn fix:special && yarn fmt",
|
|
50
50
|
"fix:code": "yarn lint:code --fix",
|
|
51
|
-
"fix:special": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node tooling/generate-wasm-code.js --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/precompile-schemas --write && node node_modules/tooling/generate-types --no-template-literals --write",
|
|
51
|
+
"fix:special": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node tooling/generate-wasm-code.js --write && node tooling/generate-html-entities.js --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/precompile-schemas --write && node node_modules/tooling/generate-types --no-template-literals --write",
|
|
52
52
|
"build:examples": "cd examples && node buildAll.js",
|
|
53
53
|
"benchmark": "node --max-old-space-size=6144 --experimental-vm-modules --trace-deprecation --hash-seed=1 --random-seed=1 --no-opt --predictable --predictable-gc-schedule --interpreted-frames-native-stack --allow-natives-syntax --expose-gc --no-concurrent-sweeping ./test/BenchmarkTestCases.benchmark.mjs",
|
|
54
54
|
"pretest": "yarn lint",
|
|
@@ -58,6 +58,8 @@
|
|
|
58
58
|
"test:basic:deno": "yarn test:base:deno --testMatch \"<rootDir>/test/*.basictest.js\"",
|
|
59
59
|
"test:unit": "yarn test:base --testMatch \"<rootDir>/test/*.unittest.js\"",
|
|
60
60
|
"test:integration": "yarn test:base --testMatch \"<rootDir>/test/*.{basictest,longtest,test}.js\"",
|
|
61
|
+
"test:integration:a": "yarn test:base --testMatch \"<rootDir>/test/*.{basictest,test}.js\"",
|
|
62
|
+
"test:integration:b": "yarn test:base --testMatch \"<rootDir>/test/*.longtest.js\"",
|
|
61
63
|
"test:test262": "yarn test:base --testMatch \"<rootDir>/test/*.spectest.js\"",
|
|
62
64
|
"test:base:deno": "deno --allow-read --allow-env --allow-sys --allow-ffi --allow-write --allow-run --v8-flags='--max-old-space-size=4096' ./node_modules/jest-cli/bin/jest.js --logHeapUsage",
|
|
63
65
|
"test:update-snapshots": "yarn test:base -u",
|
|
@@ -86,7 +88,6 @@
|
|
|
86
88
|
]
|
|
87
89
|
},
|
|
88
90
|
"dependencies": {
|
|
89
|
-
"@types/eslint-scope": "^3.7.7",
|
|
90
91
|
"@types/estree": "^1.0.8",
|
|
91
92
|
"@types/json-schema": "^7.0.15",
|
|
92
93
|
"@webassemblyjs/ast": "^1.14.1",
|
|
@@ -96,27 +97,28 @@
|
|
|
96
97
|
"acorn-import-phases": "^1.0.3",
|
|
97
98
|
"browserslist": "^4.28.1",
|
|
98
99
|
"chrome-trace-event": "^1.0.2",
|
|
99
|
-
"enhanced-resolve": "^5.
|
|
100
|
-
"es-module-lexer": "^2.
|
|
100
|
+
"enhanced-resolve": "^5.21.4",
|
|
101
|
+
"es-module-lexer": "^2.1.0",
|
|
101
102
|
"eslint-scope": "5.1.1",
|
|
102
103
|
"events": "^3.2.0",
|
|
103
104
|
"glob-to-regexp": "^0.4.1",
|
|
104
105
|
"graceful-fs": "^4.2.11",
|
|
105
|
-
"loader-runner": "^4.3.
|
|
106
|
+
"loader-runner": "^4.3.2",
|
|
106
107
|
"mime-db": "^1.54.0",
|
|
107
108
|
"neo-async": "^2.6.2",
|
|
108
109
|
"schema-utils": "^4.3.3",
|
|
109
110
|
"tapable": "^2.3.0",
|
|
110
|
-
"terser-webpack-plugin": "^5.
|
|
111
|
+
"terser-webpack-plugin": "^5.5.0",
|
|
111
112
|
"watchpack": "^2.5.1",
|
|
112
|
-
"webpack-sources": "^3.
|
|
113
|
+
"webpack-sources": "^3.4.1"
|
|
113
114
|
},
|
|
114
115
|
"devDependencies": {
|
|
115
116
|
"@babel/core": "^7.27.1",
|
|
116
117
|
"@babel/preset-react": "^7.27.1",
|
|
117
118
|
"@changesets/cli": "^2.29.8",
|
|
118
119
|
"@changesets/get-github-info": "^0.8.0",
|
|
119
|
-
"@codspeed/core": "^5.
|
|
120
|
+
"@codspeed/core": "^5.4.0",
|
|
121
|
+
"@types/eslint-scope": "^3.7.7",
|
|
120
122
|
"@types/glob-to-regexp": "^0.4.4",
|
|
121
123
|
"@types/graceful-fs": "^4.1.9",
|
|
122
124
|
"@types/jest": "^30.0.0",
|
|
@@ -125,7 +127,7 @@
|
|
|
125
127
|
"@types/node": "^25.6.0",
|
|
126
128
|
"@types/xxhashjs": "^0.2.4",
|
|
127
129
|
"@webdiscus/pug-loader": "^2.11.1",
|
|
128
|
-
"assemblyscript": "^0.28.
|
|
130
|
+
"assemblyscript": "^0.28.17",
|
|
129
131
|
"babel-loader": "^10.0.0",
|
|
130
132
|
"bundle-loader": "^0.5.6",
|
|
131
133
|
"coffee-loader": "^5.0.0",
|
|
@@ -133,14 +135,14 @@
|
|
|
133
135
|
"core-js": "^3.47.0",
|
|
134
136
|
"cspell": "^10.0.0",
|
|
135
137
|
"css-loader": "^7.1.2",
|
|
136
|
-
"date-fns": "^4.
|
|
138
|
+
"date-fns": "^4.2.1",
|
|
137
139
|
"es5-ext": "^0.10.53",
|
|
138
140
|
"es6-promise-polyfill": "^1.2.0",
|
|
139
141
|
"eslint": "^9.39.2",
|
|
140
142
|
"eslint-config-webpack": "^4.9.3",
|
|
141
143
|
"file-loader": "^6.0.0",
|
|
142
144
|
"fork-ts-checker-webpack-plugin": "^9.0.2",
|
|
143
|
-
"globals": "^17.
|
|
145
|
+
"globals": "^17.6.0",
|
|
144
146
|
"hash-wasm": "^4.9.0",
|
|
145
147
|
"html-loader": "^5.1.0",
|
|
146
148
|
"husky": "^9.0.11",
|
|
@@ -151,12 +153,12 @@
|
|
|
151
153
|
"jest-diff": "^30.3.0",
|
|
152
154
|
"jest-environment-node": "^30.3.0",
|
|
153
155
|
"jest-snapshot": "^30.3.0",
|
|
154
|
-
"jest-junit": "^
|
|
156
|
+
"jest-junit": "^17.0.0",
|
|
155
157
|
"json-loader": "^0.5.7",
|
|
156
158
|
"json5": "^2.1.3",
|
|
157
159
|
"less": "^4.6.4",
|
|
158
160
|
"less-loader": "^12.3.2",
|
|
159
|
-
"lint-staged": "^
|
|
161
|
+
"lint-staged": "^17.0.5",
|
|
160
162
|
"lodash": "^4.17.19",
|
|
161
163
|
"lodash-es": "^4.17.15",
|
|
162
164
|
"memfs": "^4.51.1",
|
|
@@ -166,8 +168,8 @@
|
|
|
166
168
|
"node-gyp": "^12.1.0",
|
|
167
169
|
"nyc": "^18.0.0",
|
|
168
170
|
"open-cli": "^9.0.0",
|
|
169
|
-
"oxc-parser": "^0.
|
|
170
|
-
"pkg-pr-new": "^0.0.
|
|
171
|
+
"oxc-parser": "^0.132.0",
|
|
172
|
+
"pkg-pr-new": "^0.0.75",
|
|
171
173
|
"prettier": "^3.8.2",
|
|
172
174
|
"prettier-2": "npm:prettier@^2",
|
|
173
175
|
"pretty-format": "^30.0.5",
|
|
@@ -185,13 +187,13 @@
|
|
|
185
187
|
"script-loader": "^0.7.2",
|
|
186
188
|
"simple-git": "^3.28.0",
|
|
187
189
|
"style-loader": "^4.0.0",
|
|
188
|
-
"terser": "^5.
|
|
189
|
-
"three": "^0.
|
|
190
|
-
"tinybench": "^6.0.
|
|
190
|
+
"terser": "^5.46.2",
|
|
191
|
+
"three": "^0.184.0",
|
|
192
|
+
"tinybench": "^6.0.1",
|
|
191
193
|
"toml": "^4.1.1",
|
|
192
|
-
"tooling": "webpack/tooling#v1.26.
|
|
194
|
+
"tooling": "webpack/tooling#v1.26.2",
|
|
193
195
|
"ts-loader": "^9.5.7",
|
|
194
|
-
"typescript": "^
|
|
196
|
+
"typescript": "^6.0.3",
|
|
195
197
|
"unified": "^11.0.5",
|
|
196
198
|
"url-loader": "^4.1.0",
|
|
197
199
|
"wast-loader": "^1.12.1",
|