webpack 5.64.2 → 5.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of webpack might be problematic. Click here for more details.
- package/lib/CacheFacade.js +2 -9
- package/lib/Chunk.js +2 -0
- package/lib/Compilation.js +79 -38
- package/lib/Dependency.js +10 -0
- package/lib/DependencyTemplate.js +9 -0
- package/lib/ExternalModule.js +93 -53
- package/lib/Generator.js +2 -0
- package/lib/Module.js +24 -1
- package/lib/ModuleFilenameHelpers.js +5 -1
- package/lib/NormalModule.js +3 -1
- package/lib/RuntimeGlobals.js +11 -1
- package/lib/RuntimePlugin.js +25 -0
- package/lib/RuntimeTemplate.js +113 -2
- package/lib/Template.js +2 -1
- package/lib/WatchIgnorePlugin.js +14 -1
- package/lib/Watching.js +32 -18
- package/lib/WebpackOptionsApply.js +43 -2
- package/lib/asset/AssetGenerator.js +10 -7
- package/lib/asset/RawDataUrlModule.js +145 -0
- package/lib/config/browserslistTargetHandler.js +38 -1
- package/lib/config/defaults.js +60 -4
- package/lib/config/target.js +10 -0
- package/lib/container/ContainerEntryModule.js +4 -3
- package/lib/css/CssGenerator.js +106 -0
- package/lib/css/CssLoadingRuntimeModule.js +393 -0
- package/lib/css/CssModulesPlugin.js +444 -0
- package/lib/css/CssParser.js +618 -0
- package/lib/css/walkCssTokens.js +659 -0
- package/lib/dependencies/CssExportDependency.js +85 -0
- package/lib/dependencies/CssImportDependency.js +75 -0
- package/lib/dependencies/CssLocalIdentifierDependency.js +119 -0
- package/lib/dependencies/CssSelfLocalIdentifierDependency.js +101 -0
- package/lib/dependencies/CssUrlDependency.js +132 -0
- package/lib/dependencies/URLDependency.js +3 -8
- package/lib/esm/ModuleChunkFormatPlugin.js +74 -49
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +1 -1
- package/lib/hmr/lazyCompilationBackend.js +3 -1
- package/lib/index.js +3 -0
- package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +2 -2
- package/lib/javascript/ChunkHelpers.js +33 -0
- package/lib/javascript/JavascriptGenerator.js +1 -0
- package/lib/javascript/JavascriptParser.js +16 -8
- package/lib/javascript/StartupHelpers.js +4 -28
- package/lib/library/AssignLibraryPlugin.js +31 -13
- package/lib/library/EnableLibraryPlugin.js +11 -0
- package/lib/node/NodeWatchFileSystem.js +85 -31
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +1 -1
- package/lib/node/RequireChunkLoadingRuntimeModule.js +1 -1
- package/lib/optimize/ConcatenatedModule.js +10 -4
- package/lib/sharing/ConsumeSharedModule.js +4 -0
- package/lib/sharing/ConsumeSharedRuntimeModule.js +25 -4
- package/lib/stats/DefaultStatsPrinterPlugin.js +1 -1
- package/lib/util/create-schema-validation.js +9 -2
- package/lib/util/extractUrlAndGlobal.js +3 -0
- package/lib/util/fs.js +10 -0
- package/lib/util/hash/xxhash64.js +2 -2
- package/lib/util/internalSerializables.js +11 -0
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +3 -3
- package/lib/webpack.js +9 -1
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +3 -2
- package/package.json +4 -4
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +63 -1
- package/schemas/plugins/DllReferencePlugin.check.js +1 -1
- package/schemas/plugins/HashedModuleIdsPlugin.check.js +1 -1
- package/schemas/plugins/ProgressPlugin.check.js +1 -1
- package/schemas/plugins/asset/AssetParserOptions.check.js +1 -1
- package/schemas/plugins/container/ContainerPlugin.check.js +1 -1
- package/schemas/plugins/container/ContainerPlugin.json +2 -1
- 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 +3 -1
- package/schemas/plugins/css/CssGeneratorOptions.check.d.ts +7 -0
- package/schemas/plugins/css/CssGeneratorOptions.check.js +6 -0
- package/schemas/plugins/css/CssGeneratorOptions.json +3 -0
- package/schemas/plugins/css/CssParserOptions.check.d.ts +7 -0
- package/schemas/plugins/css/CssParserOptions.check.js +6 -0
- package/schemas/plugins/css/CssParserOptions.json +3 -0
- package/schemas/plugins/optimize/AggressiveSplittingPlugin.check.js +1 -1
- package/schemas/plugins/optimize/LimitChunkCountPlugin.check.js +1 -1
- package/schemas/plugins/optimize/MinChunkSizePlugin.check.js +1 -1
- package/types.d.ts +147 -21
@@ -10,8 +10,8 @@ const create = require("./wasm-hash");
|
|
10
10
|
//#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1
|
11
11
|
const xxhash64 = new WebAssembly.Module(
|
12
12
|
Buffer.from(
|
13
|
-
//
|
14
|
-
"AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+
|
13
|
+
// 1170 bytes
|
14
|
+
"AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrIIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqAYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEAgAiABNQIAQoeVr6+Ytt6bnn9+hUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAiABQQRqIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL",
|
15
15
|
"base64"
|
16
16
|
)
|
17
17
|
);
|
@@ -67,6 +67,16 @@ module.exports = {
|
|
67
67
|
require("../dependencies/ContextElementDependency"),
|
68
68
|
"dependencies/CriticalDependencyWarning": () =>
|
69
69
|
require("../dependencies/CriticalDependencyWarning"),
|
70
|
+
"dependencies/CssImportDependency": () =>
|
71
|
+
require("../dependencies/CssImportDependency"),
|
72
|
+
"dependencies/CssLocalIdentifierDependency": () =>
|
73
|
+
require("../dependencies/CssLocalIdentifierDependency"),
|
74
|
+
"dependencies/CssSelfLocalIdentifierDependency": () =>
|
75
|
+
require("../dependencies/CssSelfLocalIdentifierDependency"),
|
76
|
+
"dependencies/CssExportDependency": () =>
|
77
|
+
require("../dependencies/CssExportDependency"),
|
78
|
+
"dependencies/CssUrlDependency": () =>
|
79
|
+
require("../dependencies/CssUrlDependency"),
|
70
80
|
"dependencies/DelegatedSourceDependency": () =>
|
71
81
|
require("../dependencies/DelegatedSourceDependency"),
|
72
82
|
"dependencies/DllEntryDependency": () =>
|
@@ -175,6 +185,7 @@ module.exports = {
|
|
175
185
|
ModuleParseError: () => require("../ModuleParseError"),
|
176
186
|
ModuleWarning: () => require("../ModuleWarning"),
|
177
187
|
NormalModule: () => require("../NormalModule"),
|
188
|
+
RawDataUrlModule: () => require("../asset/RawDataUrlModule"),
|
178
189
|
RawModule: () => require("../RawModule"),
|
179
190
|
"sharing/ConsumeSharedModule": () =>
|
180
191
|
require("../sharing/ConsumeSharedModule"),
|
@@ -59,13 +59,13 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
|
|
59
59
|
const {
|
60
60
|
runtimeTemplate,
|
61
61
|
outputOptions: {
|
62
|
-
globalObject,
|
63
62
|
chunkLoadingGlobal,
|
64
63
|
hotUpdateGlobal,
|
65
64
|
crossOriginLoading,
|
66
65
|
scriptType
|
67
66
|
}
|
68
67
|
} = compilation;
|
68
|
+
const globalObject = runtimeTemplate.globalObject;
|
69
69
|
const { linkPreload, linkPrefetch } =
|
70
70
|
JsonpChunkLoadingRuntimeModule.getCompilationHooks(compilation);
|
71
71
|
const fn = RuntimeGlobals.ensureChunkHandlers;
|
@@ -96,7 +96,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
|
|
96
96
|
)}]`;
|
97
97
|
const conditionMap = chunkGraph.getChunkConditionMap(chunk, chunkHasJs);
|
98
98
|
const hasJsMatcher = compileBooleanMatcher(conditionMap);
|
99
|
-
const initialChunkIds = getInitialChunkIds(chunk, chunkGraph);
|
99
|
+
const initialChunkIds = getInitialChunkIds(chunk, chunkGraph, chunkHasJs);
|
100
100
|
|
101
101
|
const stateExpression = withHmr
|
102
102
|
? `${RuntimeGlobals.hmrRuntimeStatePrefix}_jsonp`
|
@@ -419,7 +419,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
|
|
419
419
|
`if(${RuntimeGlobals.hasOwnProperty}(installedChunks, chunkId) && installedChunks[chunkId]) {`,
|
420
420
|
Template.indent("installedChunks[chunkId][0]();"),
|
421
421
|
"}",
|
422
|
-
"installedChunks[
|
422
|
+
"installedChunks[chunkId] = 0;"
|
423
423
|
]),
|
424
424
|
"}",
|
425
425
|
withOnChunkLoad
|
package/lib/webpack.js
CHANGED
@@ -96,6 +96,9 @@ const createCompiler = rawOptions => {
|
|
96
96
|
* @returns {MultiCompiler} the multi compiler object
|
97
97
|
*/
|
98
98
|
|
99
|
+
const asArray = options =>
|
100
|
+
Array.isArray(options) ? Array.from(options) : [options];
|
101
|
+
|
99
102
|
const webpack = /** @type {WebpackFunctionSingle & WebpackFunctionMulti} */ (
|
100
103
|
/**
|
101
104
|
* @param {WebpackOptions | (ReadonlyArray<WebpackOptions> & MultiCompilerOptions)} options options
|
@@ -104,8 +107,13 @@ const webpack = /** @type {WebpackFunctionSingle & WebpackFunctionMulti} */ (
|
|
104
107
|
*/
|
105
108
|
(options, callback) => {
|
106
109
|
const create = () => {
|
107
|
-
if (!
|
110
|
+
if (!asArray(options).every(webpackOptionsSchemaCheck)) {
|
108
111
|
getValidateSchema()(webpackOptionsSchema, options);
|
112
|
+
util.deprecate(
|
113
|
+
() => {},
|
114
|
+
"webpack bug: Pre-compiled schema reports error while real schema is happy. This has performance drawbacks.",
|
115
|
+
"DEP_WEBPACK_PRE_COMPILED_SCHEMA_INVALID"
|
116
|
+
)();
|
109
117
|
}
|
110
118
|
/** @type {MultiCompiler|Compiler} */
|
111
119
|
let compiler;
|
@@ -31,10 +31,11 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule {
|
|
31
31
|
chunkGraph,
|
32
32
|
compilation: {
|
33
33
|
runtimeTemplate,
|
34
|
-
outputOptions: {
|
34
|
+
outputOptions: { chunkLoadingGlobal, hotUpdateGlobal }
|
35
35
|
},
|
36
36
|
_withCreateScriptUrl: withCreateScriptUrl
|
37
37
|
} = this;
|
38
|
+
const globalObject = runtimeTemplate.globalObject;
|
38
39
|
const fn = RuntimeGlobals.ensureChunkHandlers;
|
39
40
|
const withBaseURI = this.runtimeRequirements.has(RuntimeGlobals.baseURI);
|
40
41
|
const withLoading = this.runtimeRequirements.has(
|
@@ -52,7 +53,7 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule {
|
|
52
53
|
const hasJsMatcher = compileBooleanMatcher(
|
53
54
|
chunkGraph.getChunkConditionMap(chunk, chunkHasJs)
|
54
55
|
);
|
55
|
-
const initialChunkIds = getInitialChunkIds(chunk, chunkGraph);
|
56
|
+
const initialChunkIds = getInitialChunkIds(chunk, chunkGraph, chunkHasJs);
|
56
57
|
|
57
58
|
const outputName = this.compilation.getPath(
|
58
59
|
getChunkFilenameTemplate(chunk, this.compilation.outputOptions),
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "webpack",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.66.0",
|
4
4
|
"author": "Tobias Koppers @sokra",
|
5
5
|
"description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
|
6
6
|
"license": "MIT",
|
@@ -19,7 +19,7 @@
|
|
19
19
|
"eslint-scope": "5.1.1",
|
20
20
|
"events": "^3.2.0",
|
21
21
|
"glob-to-regexp": "^0.4.1",
|
22
|
-
"graceful-fs": "^4.2.
|
22
|
+
"graceful-fs": "^4.2.9",
|
23
23
|
"json-parse-better-errors": "^1.0.2",
|
24
24
|
"loader-runner": "^4.2.0",
|
25
25
|
"mime-types": "^2.1.27",
|
@@ -27,7 +27,7 @@
|
|
27
27
|
"schema-utils": "^3.1.0",
|
28
28
|
"tapable": "^2.1.1",
|
29
29
|
"terser-webpack-plugin": "^5.1.3",
|
30
|
-
"watchpack": "^2.
|
30
|
+
"watchpack": "^2.3.1",
|
31
31
|
"webpack-sources": "^3.2.2"
|
32
32
|
},
|
33
33
|
"peerDependenciesMeta": {
|
@@ -98,7 +98,7 @@
|
|
98
98
|
"style-loader": "^2.0.0",
|
99
99
|
"terser": "^5.7.0",
|
100
100
|
"toml": "^3.0.0",
|
101
|
-
"tooling": "webpack/tooling#v1.20.
|
101
|
+
"tooling": "webpack/tooling#v1.20.1",
|
102
102
|
"ts-loader": "^8.0.2",
|
103
103
|
"typescript": "^4.2.0-beta",
|
104
104
|
"url-loader": "^4.1.0",
|