webpack 5.12.3 → 5.16.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/AutomaticPrefetchPlugin.js +1 -1
- package/lib/ChunkGraph.js +14 -4
- package/lib/Compilation.js +20 -15
- package/lib/Compiler.js +6 -3
- package/lib/ContextModule.js +2 -2
- package/lib/ContextModuleFactory.js +6 -4
- package/lib/ExportsInfo.js +0 -1
- package/lib/ExternalModuleFactoryPlugin.js +46 -3
- package/lib/FileSystemInfo.js +288 -157
- package/lib/IgnoreErrorModuleFactory.js +39 -0
- package/lib/MultiCompiler.js +2 -0
- package/lib/NormalModuleFactory.js +26 -7
- package/lib/WatchIgnorePlugin.js +6 -1
- package/lib/WebpackIsIncludedPlugin.js +85 -0
- package/lib/WebpackOptionsApply.js +2 -0
- package/lib/cache/PackFileCacheStrategy.js +5 -5
- package/lib/dependencies/AMDDefineDependency.js +1 -1
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +2 -17
- package/lib/dependencies/URLDependency.js +45 -3
- package/lib/dependencies/URLPlugin.js +33 -7
- package/lib/dependencies/WebpackIsIncludedDependency.js +80 -0
- package/lib/ids/IdHelpers.js +8 -3
- package/lib/javascript/JavascriptModulesPlugin.js +4 -3
- package/lib/library/AssignLibraryPlugin.js +13 -4
- package/lib/library/EnableLibraryPlugin.js +12 -0
- package/lib/optimize/InnerGraph.js +32 -0
- package/lib/optimize/SplitChunksPlugin.js +4 -1
- package/lib/serialization/FileMiddleware.js +1 -1
- package/lib/sharing/ProvideSharedModule.js +1 -1
- package/lib/sharing/ShareRuntimeModule.js +2 -2
- package/lib/stats/DefaultStatsPrinterPlugin.js +6 -0
- package/lib/util/fs.js +51 -11
- package/lib/util/internalSerializables.js +2 -0
- package/lib/util/processAsyncTree.js +61 -0
- package/package.json +9 -7
- package/schemas/WebpackOptions.json +62 -25
- package/schemas/plugins/container/ContainerPlugin.json +2 -1
- package/schemas/plugins/container/ModuleFederationPlugin.json +2 -1
- package/types.d.ts +339 -236
@@ -87,6 +87,18 @@ class EnableLibraryPlugin {
|
|
87
87
|
}).apply(compiler);
|
88
88
|
break;
|
89
89
|
}
|
90
|
+
case "assign-properties": {
|
91
|
+
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
|
92
|
+
const AssignLibraryPlugin = require("./AssignLibraryPlugin");
|
93
|
+
new AssignLibraryPlugin({
|
94
|
+
type,
|
95
|
+
prefix: [],
|
96
|
+
declare: false,
|
97
|
+
unnamed: "error",
|
98
|
+
named: "copy"
|
99
|
+
}).apply(compiler);
|
100
|
+
break;
|
101
|
+
}
|
90
102
|
case "assign": {
|
91
103
|
//@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697
|
92
104
|
const AssignLibraryPlugin = require("./AssignLibraryPlugin");
|
@@ -5,9 +5,14 @@
|
|
5
5
|
|
6
6
|
"use strict";
|
7
7
|
|
8
|
+
const { UsageState } = require("../ExportsInfo");
|
9
|
+
|
8
10
|
/** @typedef {import("estree").Node} AnyNode */
|
11
|
+
/** @typedef {import("../Dependency")} Dependency */
|
12
|
+
/** @typedef {import("../ModuleGraph")} ModuleGraph */
|
9
13
|
/** @typedef {import("../Parser").ParserState} ParserState */
|
10
14
|
/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */
|
15
|
+
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
|
11
16
|
|
12
17
|
/** @typedef {Map<TopLevelSymbol, Set<string | TopLevelSymbol> | true>} InnerGraph */
|
13
18
|
/** @typedef {function(boolean | Set<string> | undefined): void} UsageCallback */
|
@@ -254,6 +259,33 @@ exports.tagTopLevelSymbol = (parser, name) => {
|
|
254
259
|
return fn;
|
255
260
|
};
|
256
261
|
|
262
|
+
/**
|
263
|
+
* @param {Dependency} dependency the dependency
|
264
|
+
* @param {Set<string> | boolean} usedByExports usedByExports info
|
265
|
+
* @param {ModuleGraph} moduleGraph moduleGraph
|
266
|
+
* @param {RuntimeSpec} runtime runtime
|
267
|
+
* @returns {boolean} false, when unused. Otherwise true
|
268
|
+
*/
|
269
|
+
exports.isDependencyUsedByExports = (
|
270
|
+
dependency,
|
271
|
+
usedByExports,
|
272
|
+
moduleGraph,
|
273
|
+
runtime
|
274
|
+
) => {
|
275
|
+
if (usedByExports === false) return false;
|
276
|
+
if (usedByExports !== true && usedByExports !== undefined) {
|
277
|
+
const selfModule = moduleGraph.getParentModule(dependency);
|
278
|
+
const exportsInfo = moduleGraph.getExportsInfo(selfModule);
|
279
|
+
let used = false;
|
280
|
+
for (const exportName of usedByExports) {
|
281
|
+
if (exportsInfo.getUsed(exportName, runtime) !== UsageState.Unused)
|
282
|
+
used = true;
|
283
|
+
}
|
284
|
+
if (!used) return false;
|
285
|
+
}
|
286
|
+
return true;
|
287
|
+
};
|
288
|
+
|
257
289
|
class TopLevelSymbol {
|
258
290
|
/**
|
259
291
|
* @param {string} name name of the variable
|
@@ -1298,7 +1298,10 @@ module.exports = class SplitChunksPlugin {
|
|
1298
1298
|
) {
|
1299
1299
|
continue;
|
1300
1300
|
}
|
1301
|
-
if (
|
1301
|
+
if (
|
1302
|
+
item.chunks.size > 1 &&
|
1303
|
+
chunkGraph.getNumberOfEntryModules(chunk) > 0
|
1304
|
+
) {
|
1302
1305
|
continue;
|
1303
1306
|
}
|
1304
1307
|
for (const module of item.modules) {
|
@@ -83,11 +83,11 @@ class ShareRuntimeModule extends RuntimeModule {
|
|
83
83
|
)};`,
|
84
84
|
`var uniqueName = ${JSON.stringify(uniqueName || undefined)};`,
|
85
85
|
`var register = ${runtimeTemplate.basicFunction(
|
86
|
-
"name, version, factory",
|
86
|
+
"name, version, factory, eager",
|
87
87
|
[
|
88
88
|
"var versions = scope[name] = scope[name] || {};",
|
89
89
|
"var activeVersion = versions[version];",
|
90
|
-
"if(!activeVersion || !activeVersion.loaded && uniqueName > activeVersion.from) versions[version] = { get: factory, from: uniqueName };"
|
90
|
+
"if(!activeVersion || (!activeVersion.loaded && (!eager != !activeVersion.eager ? eager : uniqueName > activeVersion.from))) versions[version] = { get: factory, from: uniqueName, eager: !!eager };"
|
91
91
|
]
|
92
92
|
)};`,
|
93
93
|
`var initExternal = ${runtimeTemplate.basicFunction("id", [
|
@@ -11,6 +11,12 @@
|
|
11
11
|
|
12
12
|
const plural = (n, singular, plural) => (n === 1 ? singular : plural);
|
13
13
|
|
14
|
+
/**
|
15
|
+
* @param {Record<string, number>} sizes sizes by source type
|
16
|
+
* @param {Object} options options
|
17
|
+
* @param {(number) => string=} options.formatSize size formatter
|
18
|
+
* @returns {string} text
|
19
|
+
*/
|
14
20
|
const printSizes = (sizes, { formatSize = n => `${n}` }) => {
|
15
21
|
const keys = Object.keys(sizes);
|
16
22
|
if (keys.length > 1) {
|
package/lib/util/fs.js
CHANGED
@@ -7,25 +7,65 @@
|
|
7
7
|
|
8
8
|
const path = require("path");
|
9
9
|
|
10
|
-
/** @typedef {import("fs").Stats} NodeFsStats */
|
11
10
|
/** @typedef {import("../../declarations/WebpackOptions").WatchOptions} WatchOptions */
|
12
11
|
/** @typedef {import("../FileSystemInfo").FileSystemInfoEntry} FileSystemInfoEntry */
|
13
12
|
|
13
|
+
/**
|
14
|
+
* @typedef {Object} IStats
|
15
|
+
* @property {() => boolean} isFile
|
16
|
+
* @property {() => boolean} isDirectory
|
17
|
+
* @property {() => boolean} isBlockDevice
|
18
|
+
* @property {() => boolean} isCharacterDevice
|
19
|
+
* @property {() => boolean} isSymbolicLink
|
20
|
+
* @property {() => boolean} isFIFO
|
21
|
+
* @property {() => boolean} isSocket
|
22
|
+
* @property {number | bigint} dev
|
23
|
+
* @property {number | bigint} ino
|
24
|
+
* @property {number | bigint} mode
|
25
|
+
* @property {number | bigint} nlink
|
26
|
+
* @property {number | bigint} uid
|
27
|
+
* @property {number | bigint} gid
|
28
|
+
* @property {number | bigint} rdev
|
29
|
+
* @property {number | bigint} size
|
30
|
+
* @property {number | bigint} blksize
|
31
|
+
* @property {number | bigint} blocks
|
32
|
+
* @property {number | bigint} atimeMs
|
33
|
+
* @property {number | bigint} mtimeMs
|
34
|
+
* @property {number | bigint} ctimeMs
|
35
|
+
* @property {number | bigint} birthtimeMs
|
36
|
+
* @property {Date} atime
|
37
|
+
* @property {Date} mtime
|
38
|
+
* @property {Date} ctime
|
39
|
+
* @property {Date} birthtime
|
40
|
+
*/
|
41
|
+
|
42
|
+
/**
|
43
|
+
* @typedef {Object} IDirent
|
44
|
+
* @property {() => boolean} isFile
|
45
|
+
* @property {() => boolean} isDirectory
|
46
|
+
* @property {() => boolean} isBlockDevice
|
47
|
+
* @property {() => boolean} isCharacterDevice
|
48
|
+
* @property {() => boolean} isSymbolicLink
|
49
|
+
* @property {() => boolean} isFIFO
|
50
|
+
* @property {() => boolean} isSocket
|
51
|
+
* @property {string | Buffer} name
|
52
|
+
*/
|
53
|
+
|
14
54
|
/** @typedef {function(NodeJS.ErrnoException=): void} Callback */
|
15
55
|
/** @typedef {function(NodeJS.ErrnoException=, Buffer=): void} BufferCallback */
|
16
56
|
/** @typedef {function(NodeJS.ErrnoException=, Buffer|string=): void} BufferOrStringCallback */
|
17
|
-
/** @typedef {function(NodeJS.ErrnoException=, string[]=): void}
|
57
|
+
/** @typedef {function(NodeJS.ErrnoException=, (string | Buffer)[] | IDirent[]=): void} DirentArrayCallback */
|
18
58
|
/** @typedef {function(NodeJS.ErrnoException=, string=): void} StringCallback */
|
19
59
|
/** @typedef {function(NodeJS.ErrnoException=, number=): void} NumberCallback */
|
20
|
-
/** @typedef {function(NodeJS.ErrnoException=,
|
60
|
+
/** @typedef {function(NodeJS.ErrnoException=, IStats=): void} StatsCallback */
|
21
61
|
/** @typedef {function((NodeJS.ErrnoException | Error)=, any=): void} ReadJsonCallback */
|
22
62
|
|
23
63
|
/**
|
24
64
|
* @typedef {Object} Watcher
|
25
65
|
* @property {function(): void} close closes the watcher and all underlying file watchers
|
26
66
|
* @property {function(): void} pause closes the watcher, but keeps underlying file watchers alive until the next watch call
|
27
|
-
* @property {function(): Map<string, FileSystemInfoEntry>} getFileTimeInfoEntries get info about files
|
28
|
-
* @property {function(): Map<string, FileSystemInfoEntry>} getContextTimeInfoEntries get info about directories
|
67
|
+
* @property {function(): Map<string, FileSystemInfoEntry | "ignore">} getFileTimeInfoEntries get info about files
|
68
|
+
* @property {function(): Map<string, FileSystemInfoEntry | "ignore">} getContextTimeInfoEntries get info about directories
|
29
69
|
*/
|
30
70
|
|
31
71
|
/**
|
@@ -35,7 +75,7 @@ const path = require("path");
|
|
35
75
|
* @param {Iterable<string>} missing watched exitance entries
|
36
76
|
* @param {number} startTime timestamp of start time
|
37
77
|
* @param {WatchOptions} options options object
|
38
|
-
* @param {function(Error=, Map<string, FileSystemInfoEntry>, Map<string, FileSystemInfoEntry>, Set<string>, Set<string>): void} callback aggregated callback
|
78
|
+
* @param {function(Error=, Map<string, FileSystemInfoEntry | "ignore">, Map<string, FileSystemInfoEntry | "ignore">, Set<string>, Set<string>): void} callback aggregated callback
|
39
79
|
* @param {function(string, number): void} callbackUndelayed callback when the first change was detected
|
40
80
|
* @returns {Watcher} a watcher
|
41
81
|
*/
|
@@ -45,7 +85,7 @@ const path = require("path");
|
|
45
85
|
* @property {function(string, Buffer|string, Callback): void} writeFile
|
46
86
|
* @property {function(string, Callback): void} mkdir
|
47
87
|
* @property {function(string, StatsCallback): void} stat
|
48
|
-
* @property {function(string,
|
88
|
+
* @property {function(string, BufferOrStringCallback): void} readFile
|
49
89
|
* @property {(function(string, string): string)=} join
|
50
90
|
* @property {(function(string, string): string)=} relative
|
51
91
|
* @property {(function(string): string)=} dirname
|
@@ -53,12 +93,12 @@ const path = require("path");
|
|
53
93
|
|
54
94
|
/**
|
55
95
|
* @typedef {Object} InputFileSystem
|
56
|
-
* @property {function(string,
|
96
|
+
* @property {function(string, BufferOrStringCallback): void} readFile
|
57
97
|
* @property {(function(string, ReadJsonCallback): void)=} readJson
|
58
98
|
* @property {function(string, BufferOrStringCallback): void} readlink
|
59
|
-
* @property {function(string,
|
99
|
+
* @property {function(string, DirentArrayCallback): void} readdir
|
60
100
|
* @property {function(string, StatsCallback): void} stat
|
61
|
-
* @property {(function(string,
|
101
|
+
* @property {(function(string, BufferOrStringCallback): void)=} realpath
|
62
102
|
* @property {(function(string=): void)=} purge
|
63
103
|
* @property {(function(string, string): string)=} join
|
64
104
|
* @property {(function(string, string): string)=} relative
|
@@ -73,7 +113,7 @@ const path = require("path");
|
|
73
113
|
/**
|
74
114
|
* @typedef {Object} IntermediateFileSystemExtras
|
75
115
|
* @property {function(string): void} mkdirSync
|
76
|
-
* @property {function(string):
|
116
|
+
* @property {function(string): NodeJS.WritableStream} createWriteStream
|
77
117
|
* @property {function(string, string, NumberCallback): void} open
|
78
118
|
* @property {function(number, Buffer, number, number, number, NumberCallback): void} read
|
79
119
|
* @property {function(number, Callback): void} close
|
@@ -150,6 +150,8 @@ module.exports = {
|
|
150
150
|
require("../dependencies/WebAssemblyExportImportedDependency"),
|
151
151
|
"dependencies/WebAssemblyImportDependency": () =>
|
152
152
|
require("../dependencies/WebAssemblyImportDependency"),
|
153
|
+
"dependencies/WebpackIsIncludedDependency": () =>
|
154
|
+
require("../dependencies/WebpackIsIncludedDependency"),
|
153
155
|
"dependencies/WorkerDependency": () =>
|
154
156
|
require("../dependencies/WorkerDependency"),
|
155
157
|
"optimize/ConcatenatedModule": () =>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
|
6
|
+
"use strict";
|
7
|
+
|
8
|
+
/**
|
9
|
+
* @template T
|
10
|
+
* @param {Iterable<T>} items initial items
|
11
|
+
* @param {number} concurrency number of items running in parallel
|
12
|
+
* @param {function(T, function(T): void, function(Error=): void): void} processor worker which pushes more items
|
13
|
+
* @param {function(Error=): void} callback all items processed
|
14
|
+
* @returns {void}
|
15
|
+
*/
|
16
|
+
const processAsyncTree = (items, concurrency, processor, callback) => {
|
17
|
+
const queue = Array.from(items);
|
18
|
+
if (queue.length === 0) return callback();
|
19
|
+
let processing = 0;
|
20
|
+
let finished = false;
|
21
|
+
let processScheduled = true;
|
22
|
+
|
23
|
+
const push = item => {
|
24
|
+
queue.push(item);
|
25
|
+
if (!processScheduled && processing < concurrency) {
|
26
|
+
processScheduled = true;
|
27
|
+
process.nextTick(processQueue);
|
28
|
+
}
|
29
|
+
};
|
30
|
+
|
31
|
+
const processorCallback = err => {
|
32
|
+
processing--;
|
33
|
+
if (err && !finished) {
|
34
|
+
finished = true;
|
35
|
+
callback(err);
|
36
|
+
return;
|
37
|
+
}
|
38
|
+
if (!processScheduled) {
|
39
|
+
processScheduled = true;
|
40
|
+
process.nextTick(processQueue);
|
41
|
+
}
|
42
|
+
};
|
43
|
+
|
44
|
+
const processQueue = () => {
|
45
|
+
if (finished) return;
|
46
|
+
while (processing < concurrency && queue.length > 0) {
|
47
|
+
processing++;
|
48
|
+
const item = queue.pop();
|
49
|
+
processor(item, push, processorCallback);
|
50
|
+
}
|
51
|
+
processScheduled = false;
|
52
|
+
if (queue.length === 0 && processing === 0 && !finished) {
|
53
|
+
finished = true;
|
54
|
+
callback();
|
55
|
+
}
|
56
|
+
};
|
57
|
+
|
58
|
+
processQueue();
|
59
|
+
};
|
60
|
+
|
61
|
+
module.exports = processAsyncTree;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "webpack",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.16.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",
|
@@ -13,7 +13,8 @@
|
|
13
13
|
"acorn": "^8.0.4",
|
14
14
|
"browserslist": "^4.14.5",
|
15
15
|
"chrome-trace-event": "^1.0.2",
|
16
|
-
"enhanced-resolve": "^5.
|
16
|
+
"enhanced-resolve": "^5.7.0",
|
17
|
+
"es-module-lexer": "^0.3.26",
|
17
18
|
"eslint-scope": "^5.1.1",
|
18
19
|
"events": "^3.2.0",
|
19
20
|
"glob-to-regexp": "^0.4.1",
|
@@ -37,6 +38,7 @@
|
|
37
38
|
"devDependencies": {
|
38
39
|
"@babel/core": "^7.11.1",
|
39
40
|
"@babel/preset-react": "^7.10.4",
|
41
|
+
"@types/es-module-lexer": "^0.3.0",
|
40
42
|
"@types/jest": "^26.0.15",
|
41
43
|
"@types/node": "^14.14.10",
|
42
44
|
"babel-loader": "^8.1.0",
|
@@ -54,7 +56,7 @@
|
|
54
56
|
"eslint": "^7.14.0",
|
55
57
|
"eslint-config-prettier": "^7.0.0",
|
56
58
|
"eslint-plugin-jest": "^24.1.3",
|
57
|
-
"eslint-plugin-jsdoc": "^
|
59
|
+
"eslint-plugin-jsdoc": "^31.0.3",
|
58
60
|
"eslint-plugin-node": "^11.0.0",
|
59
61
|
"eslint-plugin-prettier": "^3.1.4",
|
60
62
|
"file-loader": "^6.0.0",
|
@@ -91,9 +93,9 @@
|
|
91
93
|
"style-loader": "^2.0.0",
|
92
94
|
"terser": "^5.5.0",
|
93
95
|
"toml": "^3.0.0",
|
94
|
-
"tooling": "webpack/tooling#v1.
|
96
|
+
"tooling": "webpack/tooling#v1.14.0",
|
95
97
|
"ts-loader": "^8.0.2",
|
96
|
-
"typescript": "^4.2.0-
|
98
|
+
"typescript": "^4.2.0-beta",
|
97
99
|
"url-loader": "^4.1.0",
|
98
100
|
"wast-loader": "^1.11.0",
|
99
101
|
"webassembly-feature": "1.3.0",
|
@@ -150,8 +152,8 @@
|
|
150
152
|
"type-lint": "tsc",
|
151
153
|
"typings-lint": "tsc -p tsconfig.test.json",
|
152
154
|
"spellcheck": "cspell \"{.github,benchmark,bin,examples,hot,lib,schemas,setup,tooling}/**/*.{md,yml,yaml,js,json}\" \"*.md\"",
|
153
|
-
"special-lint": "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 node_modules/tooling/format-file-header && node node_modules/tooling/compile-to-definitions && node node_modules/tooling/generate-types",
|
154
|
-
"special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/generate-types --write",
|
155
|
+
"special-lint": "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 node_modules/tooling/format-file-header && node node_modules/tooling/compile-to-definitions && node node_modules/tooling/generate-types --no-template-literals",
|
156
|
+
"special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/generate-types --no-template-literals --write",
|
155
157
|
"fix": "yarn code-lint --fix && yarn special-lint-fix && yarn pretty-lint-fix",
|
156
158
|
"pretty-lint-base": "prettier \"*.{ts,json,yml,yaml,md}\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.json\" \"examples/*.md\"",
|
157
159
|
"pretty-lint-base-all": "yarn pretty-lint-base \"*.js\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.js\" \"test/*.js\" \"test/helpers/*.js\" \"test/{configCases,watchCases,statsCases,hotCases,benchmarkCases}/**/webpack.config.js\" \"examples/**/webpack.config.js\"",
|
@@ -611,28 +611,7 @@
|
|
611
611
|
"description": "If an dependency matches exactly a property of the object, the property value is used as dependency.",
|
612
612
|
"type": "object",
|
613
613
|
"additionalProperties": {
|
614
|
-
"
|
615
|
-
"anyOf": [
|
616
|
-
{
|
617
|
-
"type": "array",
|
618
|
-
"items": {
|
619
|
-
"description": "A part of the target of the external.",
|
620
|
-
"type": "string",
|
621
|
-
"minLength": 1
|
622
|
-
}
|
623
|
-
},
|
624
|
-
{
|
625
|
-
"description": "`true`: The dependency name is used as target of the external.",
|
626
|
-
"type": "boolean"
|
627
|
-
},
|
628
|
-
{
|
629
|
-
"description": "The target of the external.",
|
630
|
-
"type": "string"
|
631
|
-
},
|
632
|
-
{
|
633
|
-
"type": "object"
|
634
|
-
}
|
635
|
-
]
|
614
|
+
"$ref": "#/definitions/ExternalItemValue"
|
636
615
|
},
|
637
616
|
"properties": {
|
638
617
|
"byLayer": {
|
@@ -655,7 +634,56 @@
|
|
655
634
|
{
|
656
635
|
"description": "The function is called on each dependency (`function(context, request, callback(err, result))`).",
|
657
636
|
"instanceof": "Function",
|
658
|
-
"tsType": "((data:
|
637
|
+
"tsType": "(((data: ExternalItemFunctionData, callback: (err?: Error, result?: ExternalItemValue) => void) => void) | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>))"
|
638
|
+
}
|
639
|
+
]
|
640
|
+
},
|
641
|
+
"ExternalItemFunctionData": {
|
642
|
+
"description": "Data object passed as argument when a function is set for 'externals'.",
|
643
|
+
"type": "object",
|
644
|
+
"additionalProperties": false,
|
645
|
+
"properties": {
|
646
|
+
"context": {
|
647
|
+
"description": "The directory in which the request is placed.",
|
648
|
+
"type": "string"
|
649
|
+
},
|
650
|
+
"contextInfo": {
|
651
|
+
"description": "Contextual information.",
|
652
|
+
"type": "object",
|
653
|
+
"tsType": "import('../lib/ModuleFactory').ModuleFactoryCreateDataContextInfo"
|
654
|
+
},
|
655
|
+
"getResolve": {
|
656
|
+
"description": "Get a resolve function with the current resolver options.",
|
657
|
+
"instanceof": "Function",
|
658
|
+
"tsType": "((options?: ResolveOptions) => ((context: string, request: string, callback: (err?: Error, result?: string) => void) => void) | ((context: string, request: string) => Promise<string>))"
|
659
|
+
},
|
660
|
+
"request": {
|
661
|
+
"description": "The request as written by the user in the require/import expression/statement.",
|
662
|
+
"type": "string"
|
663
|
+
}
|
664
|
+
}
|
665
|
+
},
|
666
|
+
"ExternalItemValue": {
|
667
|
+
"description": "The dependency used for the external.",
|
668
|
+
"anyOf": [
|
669
|
+
{
|
670
|
+
"type": "array",
|
671
|
+
"items": {
|
672
|
+
"description": "A part of the target of the external.",
|
673
|
+
"type": "string",
|
674
|
+
"minLength": 1
|
675
|
+
}
|
676
|
+
},
|
677
|
+
{
|
678
|
+
"description": "`true`: The dependency name is used as target of the external.",
|
679
|
+
"type": "boolean"
|
680
|
+
},
|
681
|
+
{
|
682
|
+
"description": "The target of the external.",
|
683
|
+
"type": "string"
|
684
|
+
},
|
685
|
+
{
|
686
|
+
"type": "object"
|
659
687
|
}
|
660
688
|
]
|
661
689
|
},
|
@@ -1224,13 +1252,14 @@
|
|
1224
1252
|
"required": ["type"]
|
1225
1253
|
},
|
1226
1254
|
"LibraryType": {
|
1227
|
-
"description": "Type of library (types included by default are 'var', 'module', 'assign', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).",
|
1255
|
+
"description": "Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).",
|
1228
1256
|
"anyOf": [
|
1229
1257
|
{
|
1230
1258
|
"enum": [
|
1231
1259
|
"var",
|
1232
1260
|
"module",
|
1233
1261
|
"assign",
|
1262
|
+
"assign-properties",
|
1234
1263
|
"this",
|
1235
1264
|
"window",
|
1236
1265
|
"self",
|
@@ -2861,6 +2890,10 @@
|
|
2861
2890
|
]
|
2862
2891
|
}
|
2863
2892
|
},
|
2893
|
+
"preferAbsolute": {
|
2894
|
+
"description": "Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.",
|
2895
|
+
"type": "boolean"
|
2896
|
+
},
|
2864
2897
|
"preferRelative": {
|
2865
2898
|
"description": "Prefer to resolve module requests as relative request and fallback to resolving as module.",
|
2866
2899
|
"type": "boolean"
|
@@ -2888,7 +2921,7 @@
|
|
2888
2921
|
}
|
2889
2922
|
},
|
2890
2923
|
"roots": {
|
2891
|
-
"description": "A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
|
2924
|
+
"description": "A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.",
|
2892
2925
|
"type": "array",
|
2893
2926
|
"items": {
|
2894
2927
|
"description": "Directory in which requests that are server-relative URLs (starting with '/') are resolved.",
|
@@ -3538,6 +3571,10 @@
|
|
3538
3571
|
"description": "Add built modules information to chunk information.",
|
3539
3572
|
"type": "boolean"
|
3540
3573
|
},
|
3574
|
+
"chunkModulesSpace": {
|
3575
|
+
"description": "Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).",
|
3576
|
+
"type": "number"
|
3577
|
+
},
|
3541
3578
|
"chunkOrigins": {
|
3542
3579
|
"description": "Add the origins of chunks and chunk merging info.",
|
3543
3580
|
"type": "boolean"
|
@@ -201,13 +201,14 @@
|
|
201
201
|
"required": ["type"]
|
202
202
|
},
|
203
203
|
"LibraryType": {
|
204
|
-
"description": "Type of library (types included by default are 'var', 'module', 'assign', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).",
|
204
|
+
"description": "Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).",
|
205
205
|
"anyOf": [
|
206
206
|
{
|
207
207
|
"enum": [
|
208
208
|
"var",
|
209
209
|
"module",
|
210
210
|
"assign",
|
211
|
+
"assign-properties",
|
211
212
|
"this",
|
212
213
|
"window",
|
213
214
|
"self",
|
@@ -225,13 +225,14 @@
|
|
225
225
|
"required": ["type"]
|
226
226
|
},
|
227
227
|
"LibraryType": {
|
228
|
-
"description": "Type of library (types included by default are 'var', 'module', 'assign', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).",
|
228
|
+
"description": "Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).",
|
229
229
|
"anyOf": [
|
230
230
|
{
|
231
231
|
"enum": [
|
232
232
|
"var",
|
233
233
|
"module",
|
234
234
|
"assign",
|
235
|
+
"assign-properties",
|
235
236
|
"this",
|
236
237
|
"window",
|
237
238
|
"self",
|