webpack 5.64.3 → 5.64.4
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/WatchIgnorePlugin.js +14 -1
- package/lib/Watching.js +31 -17
- package/lib/container/ContainerEntryModule.js +3 -0
- package/lib/esm/ModuleChunkFormatPlugin.js +74 -49
- package/lib/javascript/ChunkHelpers.js +33 -0
- package/lib/javascript/JavascriptParser.js +9 -8
- package/lib/javascript/StartupHelpers.js +1 -25
- package/lib/node/NodeWatchFileSystem.js +85 -31
- package/lib/sharing/ConsumeSharedRuntimeModule.js +4 -4
- package/lib/util/fs.js +10 -0
- package/package.json +2 -2
- package/types.d.ts +26 -0
package/lib/WatchIgnorePlugin.js
CHANGED
@@ -87,7 +87,20 @@ class IgnoringWatchFileSystem {
|
|
87
87
|
fileTimestamps.set(path, IGNORE_TIME_ENTRY);
|
88
88
|
}
|
89
89
|
return fileTimestamps;
|
90
|
-
}
|
90
|
+
},
|
91
|
+
getInfo:
|
92
|
+
watcher.getInfo &&
|
93
|
+
(() => {
|
94
|
+
const info = watcher.getInfo();
|
95
|
+
const { fileTimeInfoEntries, contextTimeInfoEntries } = info;
|
96
|
+
for (const path of ignoredFiles) {
|
97
|
+
fileTimeInfoEntries.set(path, IGNORE_TIME_ENTRY);
|
98
|
+
}
|
99
|
+
for (const path of ignoredDirs) {
|
100
|
+
contextTimeInfoEntries.set(path, IGNORE_TIME_ENTRY);
|
101
|
+
}
|
102
|
+
return info;
|
103
|
+
})
|
91
104
|
};
|
92
105
|
}
|
93
106
|
}
|
package/lib/Watching.js
CHANGED
@@ -109,30 +109,44 @@ class Watching {
|
|
109
109
|
this.lastWatcherStartTime = Date.now();
|
110
110
|
}
|
111
111
|
this.compiler.fsStartTime = Date.now();
|
112
|
-
|
113
|
-
changedFiles
|
114
|
-
|
112
|
+
if (
|
113
|
+
changedFiles &&
|
114
|
+
removedFiles &&
|
115
|
+
fileTimeInfoEntries &&
|
116
|
+
contextTimeInfoEntries
|
117
|
+
) {
|
118
|
+
this._mergeWithCollected(changedFiles, removedFiles);
|
119
|
+
this.compiler.fileTimestamps = fileTimeInfoEntries;
|
120
|
+
this.compiler.contextTimestamps = contextTimeInfoEntries;
|
121
|
+
} else if (this.pausedWatcher) {
|
122
|
+
if (this.pausedWatcher.getInfo) {
|
123
|
+
const {
|
124
|
+
changes,
|
125
|
+
removals,
|
126
|
+
fileTimeInfoEntries,
|
127
|
+
contextTimeInfoEntries
|
128
|
+
} = this.pausedWatcher.getInfo();
|
129
|
+
this._mergeWithCollected(changes, removals);
|
130
|
+
this.compiler.fileTimestamps = fileTimeInfoEntries;
|
131
|
+
this.compiler.contextTimestamps = contextTimeInfoEntries;
|
132
|
+
} else {
|
133
|
+
this._mergeWithCollected(
|
115
134
|
this.pausedWatcher.getAggregatedChanges &&
|
116
|
-
|
117
|
-
(this.compiler.removedFiles =
|
118
|
-
removedFiles ||
|
119
|
-
(this.pausedWatcher &&
|
135
|
+
this.pausedWatcher.getAggregatedChanges(),
|
120
136
|
this.pausedWatcher.getAggregatedRemovals &&
|
121
|
-
|
122
|
-
|
123
|
-
|
137
|
+
this.pausedWatcher.getAggregatedRemovals()
|
138
|
+
);
|
139
|
+
this.compiler.fileTimestamps =
|
140
|
+
this.pausedWatcher.getFileTimeInfoEntries();
|
141
|
+
this.compiler.contextTimestamps =
|
142
|
+
this.pausedWatcher.getContextTimeInfoEntries();
|
143
|
+
}
|
144
|
+
}
|
124
145
|
this.compiler.modifiedFiles = this._collectedChangedFiles;
|
125
146
|
this._collectedChangedFiles = undefined;
|
126
147
|
this.compiler.removedFiles = this._collectedRemovedFiles;
|
127
148
|
this._collectedRemovedFiles = undefined;
|
128
149
|
|
129
|
-
this.compiler.fileTimestamps =
|
130
|
-
fileTimeInfoEntries ||
|
131
|
-
(this.pausedWatcher && this.pausedWatcher.getFileTimeInfoEntries());
|
132
|
-
this.compiler.contextTimestamps =
|
133
|
-
contextTimeInfoEntries ||
|
134
|
-
(this.pausedWatcher && this.pausedWatcher.getContextTimeInfoEntries());
|
135
|
-
|
136
150
|
const run = () => {
|
137
151
|
if (this.compiler.idle) {
|
138
152
|
return this.compiler.cache.endIdle(err => {
|
@@ -10,6 +10,7 @@ const AsyncDependenciesBlock = require("../AsyncDependenciesBlock");
|
|
10
10
|
const Module = require("../Module");
|
11
11
|
const RuntimeGlobals = require("../RuntimeGlobals");
|
12
12
|
const Template = require("../Template");
|
13
|
+
const StaticExportsDependency = require("../dependencies/StaticExportsDependency");
|
13
14
|
const makeSerializable = require("../util/makeSerializable");
|
14
15
|
const ContainerExposedDependency = require("./ContainerExposedDependency");
|
15
16
|
|
@@ -104,6 +105,7 @@ class ContainerEntryModule extends Module {
|
|
104
105
|
strict: true,
|
105
106
|
topLevelDeclarations: new Set(["moduleMap", "get", "init"])
|
106
107
|
};
|
108
|
+
this.buildMeta.exportsType = "namespace";
|
107
109
|
|
108
110
|
this.clearDependenciesAndBlocks();
|
109
111
|
|
@@ -127,6 +129,7 @@ class ContainerEntryModule extends Module {
|
|
127
129
|
}
|
128
130
|
this.addBlock(block);
|
129
131
|
}
|
132
|
+
this.addDependency(new StaticExportsDependency(["get", "init"], false));
|
130
133
|
|
131
134
|
callback();
|
132
135
|
}
|
@@ -5,18 +5,16 @@
|
|
5
5
|
|
6
6
|
"use strict";
|
7
7
|
|
8
|
-
const { ConcatSource
|
8
|
+
const { ConcatSource } = require("webpack-sources");
|
9
9
|
const { RuntimeGlobals } = require("..");
|
10
10
|
const HotUpdateChunk = require("../HotUpdateChunk");
|
11
11
|
const Template = require("../Template");
|
12
|
+
const { getAllChunks } = require("../javascript/ChunkHelpers");
|
12
13
|
const {
|
13
14
|
getCompilationHooks,
|
14
15
|
getChunkFilenameTemplate
|
15
16
|
} = require("../javascript/JavascriptModulesPlugin");
|
16
|
-
const {
|
17
|
-
generateEntryStartup,
|
18
|
-
updateHashForEntryStartup
|
19
|
-
} = require("../javascript/StartupHelpers");
|
17
|
+
const { updateHashForEntryStartup } = require("../javascript/StartupHelpers");
|
20
18
|
|
21
19
|
/** @typedef {import("../Compiler")} Compiler */
|
22
20
|
|
@@ -84,63 +82,90 @@ class ModuleChunkFormatPlugin {
|
|
84
82
|
}
|
85
83
|
)
|
86
84
|
.split("/");
|
87
|
-
const runtimeOutputName = compilation
|
88
|
-
.getPath(
|
89
|
-
getChunkFilenameTemplate(
|
90
|
-
runtimeChunk,
|
91
|
-
compilation.outputOptions
|
92
|
-
),
|
93
|
-
{
|
94
|
-
chunk: runtimeChunk,
|
95
|
-
contentHashType: "javascript"
|
96
|
-
}
|
97
|
-
)
|
98
|
-
.split("/");
|
99
85
|
|
100
86
|
// remove filename, we only need the directory
|
101
|
-
|
87
|
+
currentOutputName.pop();
|
102
88
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
89
|
+
const getRelativePath = chunk => {
|
90
|
+
const baseOutputName = currentOutputName.slice();
|
91
|
+
const chunkOutputName = compilation
|
92
|
+
.getPath(
|
93
|
+
getChunkFilenameTemplate(
|
94
|
+
chunk,
|
95
|
+
compilation.outputOptions
|
96
|
+
),
|
97
|
+
{
|
98
|
+
chunk: chunk,
|
99
|
+
contentHashType: "javascript"
|
100
|
+
}
|
101
|
+
)
|
102
|
+
.split("/");
|
112
103
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
104
|
+
// remove common parts
|
105
|
+
while (
|
106
|
+
baseOutputName.length > 0 &&
|
107
|
+
chunkOutputName.length > 0 &&
|
108
|
+
baseOutputName[0] === chunkOutputName[0]
|
109
|
+
) {
|
110
|
+
baseOutputName.shift();
|
111
|
+
chunkOutputName.shift();
|
112
|
+
}
|
113
|
+
// create final path
|
114
|
+
return (
|
115
|
+
(baseOutputName.length > 0
|
116
|
+
? "../".repeat(baseOutputName.length)
|
117
|
+
: "./") + chunkOutputName.join("/")
|
118
|
+
);
|
119
|
+
};
|
118
120
|
|
119
121
|
const entrySource = new ConcatSource();
|
120
122
|
entrySource.add(source);
|
121
123
|
entrySource.add(";\n\n// load runtime\n");
|
122
124
|
entrySource.add(
|
123
125
|
`import __webpack_require__ from ${JSON.stringify(
|
124
|
-
|
125
|
-
)};\n`
|
126
|
-
);
|
127
|
-
entrySource.add(
|
128
|
-
`import * as __webpack_self_exports__ from ${JSON.stringify(
|
129
|
-
"./" + outputFilename
|
126
|
+
getRelativePath(runtimeChunk)
|
130
127
|
)};\n`
|
131
128
|
);
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
entries,
|
140
|
-
chunk,
|
141
|
-
false
|
142
|
-
)
|
129
|
+
|
130
|
+
const startupSource = new ConcatSource();
|
131
|
+
startupSource.add(
|
132
|
+
`var __webpack_exec__ = ${runtimeTemplate.returningFunction(
|
133
|
+
`__webpack_require__(${RuntimeGlobals.entryModuleId} = moduleId)`,
|
134
|
+
"moduleId"
|
135
|
+
)}\n`
|
143
136
|
);
|
137
|
+
|
138
|
+
const loadedChunks = new Set();
|
139
|
+
let index = 0;
|
140
|
+
for (let i = 0; i < entries.length; i++) {
|
141
|
+
const [module, entrypoint] = entries[i];
|
142
|
+
const final = i + 1 === entries.length;
|
143
|
+
const moduleId = chunkGraph.getModuleId(module);
|
144
|
+
const chunks = getAllChunks(
|
145
|
+
entrypoint,
|
146
|
+
runtimeChunk,
|
147
|
+
undefined
|
148
|
+
);
|
149
|
+
for (const chunk of chunks) {
|
150
|
+
if (loadedChunks.has(chunk)) continue;
|
151
|
+
loadedChunks.add(chunk);
|
152
|
+
startupSource.add(
|
153
|
+
`import * as __webpack_chunk_${index}__ from ${JSON.stringify(
|
154
|
+
getRelativePath(chunk)
|
155
|
+
)};\n`
|
156
|
+
);
|
157
|
+
startupSource.add(
|
158
|
+
`${RuntimeGlobals.externalInstallChunk}(__webpack_chunk_${index}__);\n`
|
159
|
+
);
|
160
|
+
index++;
|
161
|
+
}
|
162
|
+
startupSource.add(
|
163
|
+
`${
|
164
|
+
final ? "var __webpack_exports__ = " : ""
|
165
|
+
}__webpack_exec__(${JSON.stringify(moduleId)});\n`
|
166
|
+
);
|
167
|
+
}
|
168
|
+
|
144
169
|
entrySource.add(
|
145
170
|
hooks.renderStartup.call(
|
146
171
|
startupSource,
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
|
6
|
+
"use strict";
|
7
|
+
|
8
|
+
const Entrypoint = require("../Entrypoint");
|
9
|
+
|
10
|
+
/** @typedef {import("../Chunk")} Chunk */
|
11
|
+
|
12
|
+
/**
|
13
|
+
* @param {Entrypoint} entrypoint a chunk group
|
14
|
+
* @param {Chunk} excludedChunk1 current chunk which is excluded
|
15
|
+
* @param {Chunk} excludedChunk2 runtime chunk which is excluded
|
16
|
+
* @returns {Set<Chunk>} chunks
|
17
|
+
*/
|
18
|
+
const getAllChunks = (entrypoint, excludedChunk1, excludedChunk2) => {
|
19
|
+
const queue = new Set([entrypoint]);
|
20
|
+
const chunks = new Set();
|
21
|
+
for (const entrypoint of queue) {
|
22
|
+
for (const chunk of entrypoint.chunks) {
|
23
|
+
if (chunk === excludedChunk1) continue;
|
24
|
+
if (chunk === excludedChunk2) continue;
|
25
|
+
chunks.add(chunk);
|
26
|
+
}
|
27
|
+
for (const parent of entrypoint.parentsIterable) {
|
28
|
+
if (parent instanceof Entrypoint) queue.add(parent);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
return chunks;
|
32
|
+
};
|
33
|
+
exports.getAllChunks = getAllChunks;
|
@@ -1189,14 +1189,15 @@ class JavascriptParser extends Parser {
|
|
1189
1189
|
const node = /** @type {TaggedTemplateExpressionNode} */ (_node);
|
1190
1190
|
const tag = this.evaluateExpression(node.tag);
|
1191
1191
|
|
1192
|
-
if (tag.isIdentifier() && tag.identifier
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1192
|
+
if (tag.isIdentifier() && tag.identifier === "String.raw") {
|
1193
|
+
const { quasis, parts } = getSimplifiedTemplateResult(
|
1194
|
+
"raw",
|
1195
|
+
node.quasi
|
1196
|
+
);
|
1197
|
+
return new BasicEvaluatedExpression()
|
1198
|
+
.setTemplateString(quasis, parts, "raw")
|
1199
|
+
.setRange(node.range);
|
1200
|
+
}
|
1200
1201
|
});
|
1201
1202
|
|
1202
1203
|
this.hooks.evaluateCallExpressionMember
|
@@ -5,10 +5,10 @@
|
|
5
5
|
|
6
6
|
"use strict";
|
7
7
|
|
8
|
-
const Entrypoint = require("../Entrypoint");
|
9
8
|
const RuntimeGlobals = require("../RuntimeGlobals");
|
10
9
|
const Template = require("../Template");
|
11
10
|
const { isSubset } = require("../util/SetHelpers");
|
11
|
+
const { getAllChunks } = require("./ChunkHelpers");
|
12
12
|
const { chunkHasJs } = require("./JavascriptModulesPlugin");
|
13
13
|
|
14
14
|
/** @typedef {import("../util/Hash")} Hash */
|
@@ -19,30 +19,6 @@ const { chunkHasJs } = require("./JavascriptModulesPlugin");
|
|
19
19
|
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
|
20
20
|
/** @typedef {(string|number)[]} EntryItem */
|
21
21
|
|
22
|
-
// TODO move to this file to ../javascript/ChunkHelpers.js
|
23
|
-
|
24
|
-
/**
|
25
|
-
* @param {Entrypoint} entrypoint a chunk group
|
26
|
-
* @param {Chunk} excludedChunk1 current chunk which is excluded
|
27
|
-
* @param {Chunk} excludedChunk2 runtime chunk which is excluded
|
28
|
-
* @returns {Set<Chunk>} chunks
|
29
|
-
*/
|
30
|
-
const getAllChunks = (entrypoint, excludedChunk1, excludedChunk2) => {
|
31
|
-
const queue = new Set([entrypoint]);
|
32
|
-
const chunks = new Set();
|
33
|
-
for (const entrypoint of queue) {
|
34
|
-
for (const chunk of entrypoint.chunks) {
|
35
|
-
if (chunk === excludedChunk1) continue;
|
36
|
-
if (chunk === excludedChunk2) continue;
|
37
|
-
chunks.add(chunk);
|
38
|
-
}
|
39
|
-
for (const parent of entrypoint.parentsIterable) {
|
40
|
-
if (parent instanceof Entrypoint) queue.add(parent);
|
41
|
-
}
|
42
|
-
}
|
43
|
-
return chunks;
|
44
|
-
};
|
45
|
-
|
46
22
|
const EXPORT_PREFIX = "var __webpack_exports__ = ";
|
47
23
|
|
48
24
|
/**
|
@@ -5,6 +5,7 @@
|
|
5
5
|
|
6
6
|
"use strict";
|
7
7
|
|
8
|
+
const util = require("util");
|
8
9
|
const Watchpack = require("watchpack");
|
9
10
|
|
10
11
|
/** @typedef {import("../../declarations/WebpackOptions").WatchOptions} WatchOptions */
|
@@ -68,7 +69,22 @@ class NodeWatchFileSystem {
|
|
68
69
|
if (callbackUndelayed) {
|
69
70
|
this.watcher.once("change", callbackUndelayed);
|
70
71
|
}
|
72
|
+
|
73
|
+
const fetchTimeInfo = () => {
|
74
|
+
const fileTimeInfoEntries = new Map();
|
75
|
+
const contextTimeInfoEntries = new Map();
|
76
|
+
if (this.watcher) {
|
77
|
+
this.watcher.collectTimeInfoEntries(
|
78
|
+
fileTimeInfoEntries,
|
79
|
+
contextTimeInfoEntries
|
80
|
+
);
|
81
|
+
}
|
82
|
+
return { fileTimeInfoEntries, contextTimeInfoEntries };
|
83
|
+
};
|
71
84
|
this.watcher.once("aggregated", (changes, removals) => {
|
85
|
+
// pause emitting events (avoids clearing aggregated changes and removals on timeout)
|
86
|
+
this.watcher.pause();
|
87
|
+
|
72
88
|
if (this.inputFileSystem && this.inputFileSystem.purge) {
|
73
89
|
const fs = this.inputFileSystem;
|
74
90
|
for (const item of changes) {
|
@@ -78,8 +94,14 @@ class NodeWatchFileSystem {
|
|
78
94
|
fs.purge(item);
|
79
95
|
}
|
80
96
|
}
|
81
|
-
const
|
82
|
-
callback(
|
97
|
+
const { fileTimeInfoEntries, contextTimeInfoEntries } = fetchTimeInfo();
|
98
|
+
callback(
|
99
|
+
null,
|
100
|
+
fileTimeInfoEntries,
|
101
|
+
contextTimeInfoEntries,
|
102
|
+
changes,
|
103
|
+
removals
|
104
|
+
);
|
83
105
|
});
|
84
106
|
|
85
107
|
this.watcher.watch({ files, directories, missing, startTime });
|
@@ -99,39 +121,71 @@ class NodeWatchFileSystem {
|
|
99
121
|
this.watcher.pause();
|
100
122
|
}
|
101
123
|
},
|
102
|
-
getAggregatedRemovals: (
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
124
|
+
getAggregatedRemovals: util.deprecate(
|
125
|
+
() => {
|
126
|
+
const items = this.watcher && this.watcher.aggregatedRemovals;
|
127
|
+
if (items && this.inputFileSystem && this.inputFileSystem.purge) {
|
128
|
+
const fs = this.inputFileSystem;
|
129
|
+
for (const item of items) {
|
130
|
+
fs.purge(item);
|
131
|
+
}
|
108
132
|
}
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
133
|
+
return items;
|
134
|
+
},
|
135
|
+
"Watcher.getAggregatedRemovals is deprecated in favor of Watcher.getInfo since that's more performant.",
|
136
|
+
"DEP_WEBPACK_WATCHER_GET_AGGREGATED_REMOVALS"
|
137
|
+
),
|
138
|
+
getAggregatedChanges: util.deprecate(
|
139
|
+
() => {
|
140
|
+
const items = this.watcher && this.watcher.aggregatedChanges;
|
141
|
+
if (items && this.inputFileSystem && this.inputFileSystem.purge) {
|
142
|
+
const fs = this.inputFileSystem;
|
143
|
+
for (const item of items) {
|
144
|
+
fs.purge(item);
|
145
|
+
}
|
146
|
+
}
|
147
|
+
return items;
|
148
|
+
},
|
149
|
+
"Watcher.getAggregatedChanges is deprecated in favor of Watcher.getInfo since that's more performant.",
|
150
|
+
"DEP_WEBPACK_WATCHER_GET_AGGREGATED_CHANGES"
|
151
|
+
),
|
152
|
+
getFileTimeInfoEntries: util.deprecate(
|
153
|
+
() => {
|
154
|
+
return fetchTimeInfo().fileTimeInfoEntries;
|
155
|
+
},
|
156
|
+
"Watcher.getFileTimeInfoEntries is deprecated in favor of Watcher.getInfo since that's more performant.",
|
157
|
+
"DEP_WEBPACK_WATCHER_FILE_TIME_INFO_ENTRIES"
|
158
|
+
),
|
159
|
+
getContextTimeInfoEntries: util.deprecate(
|
160
|
+
() => {
|
161
|
+
return fetchTimeInfo().contextTimeInfoEntries;
|
162
|
+
},
|
163
|
+
"Watcher.getContextTimeInfoEntries is deprecated in favor of Watcher.getInfo since that's more performant.",
|
164
|
+
"DEP_WEBPACK_WATCHER_CONTEXT_TIME_INFO_ENTRIES"
|
165
|
+
),
|
166
|
+
getInfo: () => {
|
167
|
+
const removals = this.watcher && this.watcher.aggregatedRemovals;
|
168
|
+
const changes = this.watcher && this.watcher.aggregatedChanges;
|
169
|
+
if (this.inputFileSystem && this.inputFileSystem.purge) {
|
115
170
|
const fs = this.inputFileSystem;
|
116
|
-
|
117
|
-
|
171
|
+
if (removals) {
|
172
|
+
for (const item of removals) {
|
173
|
+
fs.purge(item);
|
174
|
+
}
|
175
|
+
}
|
176
|
+
if (changes) {
|
177
|
+
for (const item of changes) {
|
178
|
+
fs.purge(item);
|
179
|
+
}
|
118
180
|
}
|
119
181
|
}
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
}
|
128
|
-
},
|
129
|
-
getContextTimeInfoEntries: () => {
|
130
|
-
if (this.watcher) {
|
131
|
-
return this.watcher.getTimeInfoEntries();
|
132
|
-
} else {
|
133
|
-
return new Map();
|
134
|
-
}
|
182
|
+
const { fileTimeInfoEntries, contextTimeInfoEntries } = fetchTimeInfo();
|
183
|
+
return {
|
184
|
+
changes,
|
185
|
+
removals,
|
186
|
+
fileTimeInfoEntries,
|
187
|
+
contextTimeInfoEntries
|
188
|
+
};
|
135
189
|
}
|
136
190
|
};
|
137
191
|
}
|
@@ -103,9 +103,9 @@ class ConsumeSharedRuntimeModule extends RuntimeModule {
|
|
103
103
|
]
|
104
104
|
)};`,
|
105
105
|
`var getInvalidSingletonVersionMessage = ${runtimeTemplate.basicFunction(
|
106
|
-
"key, version, requiredVersion",
|
106
|
+
"scope, key, version, requiredVersion",
|
107
107
|
[
|
108
|
-
`return "Unsatisfied version " + version + " of shared singleton module " + key + " (required " + rangeToString(requiredVersion) + ")"`
|
108
|
+
`return "Unsatisfied version " + version + " from " + (version && scope[key][version].from) + " of shared singleton module " + key + " (required " + rangeToString(requiredVersion) + ")"`
|
109
109
|
]
|
110
110
|
)};`,
|
111
111
|
`var getSingletonVersion = ${runtimeTemplate.basicFunction(
|
@@ -113,7 +113,7 @@ class ConsumeSharedRuntimeModule extends RuntimeModule {
|
|
113
113
|
[
|
114
114
|
"var version = findSingletonVersionKey(scope, key);",
|
115
115
|
"if (!satisfy(requiredVersion, version)) " +
|
116
|
-
'typeof console !== "undefined" && console.warn && console.warn(getInvalidSingletonVersionMessage(key, version, requiredVersion));',
|
116
|
+
'typeof console !== "undefined" && console.warn && console.warn(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));',
|
117
117
|
"return get(scope[key][version]);"
|
118
118
|
]
|
119
119
|
)};`,
|
@@ -122,7 +122,7 @@ class ConsumeSharedRuntimeModule extends RuntimeModule {
|
|
122
122
|
[
|
123
123
|
"var version = findSingletonVersionKey(scope, key);",
|
124
124
|
"if (!satisfy(requiredVersion, version)) " +
|
125
|
-
"throw new Error(getInvalidSingletonVersionMessage(key, version, requiredVersion));",
|
125
|
+
"throw new Error(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));",
|
126
126
|
"return get(scope[key][version]);"
|
127
127
|
]
|
128
128
|
)};`,
|
package/lib/util/fs.js
CHANGED
@@ -61,6 +61,15 @@ const path = require("path");
|
|
61
61
|
/** @typedef {function((NodeJS.ErrnoException | Error | null)=, any=): void} ReadJsonCallback */
|
62
62
|
/** @typedef {function((NodeJS.ErrnoException | Error | null)=, IStats|string=): void} LstatReadlinkAbsoluteCallback */
|
63
63
|
|
64
|
+
/**
|
65
|
+
* @typedef {Object} WatcherInfo
|
66
|
+
* @property {Set<string>} changes get current aggregated changes that have not yet send to callback
|
67
|
+
* @property {Set<string>} removals get current aggregated removals that have not yet send to callback
|
68
|
+
* @property {Map<string, FileSystemInfoEntry | "ignore">} fileTimeInfoEntries get info about files
|
69
|
+
* @property {Map<string, FileSystemInfoEntry | "ignore">} contextTimeInfoEntries get info about directories
|
70
|
+
*/
|
71
|
+
|
72
|
+
// TODO webpack 6 deprecate missing getInfo
|
64
73
|
/**
|
65
74
|
* @typedef {Object} Watcher
|
66
75
|
* @property {function(): void} close closes the watcher and all underlying file watchers
|
@@ -69,6 +78,7 @@ const path = require("path");
|
|
69
78
|
* @property {function(): Set<string>=} getAggregatedRemovals get current aggregated removals that have not yet send to callback
|
70
79
|
* @property {function(): Map<string, FileSystemInfoEntry | "ignore">} getFileTimeInfoEntries get info about files
|
71
80
|
* @property {function(): Map<string, FileSystemInfoEntry | "ignore">} getContextTimeInfoEntries get info about directories
|
81
|
+
* @property {function(): WatcherInfo=} getInfo get info about timestamps and changes
|
72
82
|
*/
|
73
83
|
|
74
84
|
/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "webpack",
|
3
|
-
"version": "5.64.
|
3
|
+
"version": "5.64.4",
|
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",
|
@@ -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.0",
|
31
31
|
"webpack-sources": "^3.2.2"
|
32
32
|
},
|
33
33
|
"peerDependenciesMeta": {
|
package/types.d.ts
CHANGED
@@ -11741,6 +11741,32 @@ declare interface Watcher {
|
|
11741
11741
|
* get info about directories
|
11742
11742
|
*/
|
11743
11743
|
getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
|
11744
|
+
|
11745
|
+
/**
|
11746
|
+
* get info about timestamps and changes
|
11747
|
+
*/
|
11748
|
+
getInfo?: () => WatcherInfo;
|
11749
|
+
}
|
11750
|
+
declare interface WatcherInfo {
|
11751
|
+
/**
|
11752
|
+
* get current aggregated changes that have not yet send to callback
|
11753
|
+
*/
|
11754
|
+
changes: Set<string>;
|
11755
|
+
|
11756
|
+
/**
|
11757
|
+
* get current aggregated removals that have not yet send to callback
|
11758
|
+
*/
|
11759
|
+
removals: Set<string>;
|
11760
|
+
|
11761
|
+
/**
|
11762
|
+
* get info about files
|
11763
|
+
*/
|
11764
|
+
fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
|
11765
|
+
|
11766
|
+
/**
|
11767
|
+
* get info about directories
|
11768
|
+
*/
|
11769
|
+
contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
|
11744
11770
|
}
|
11745
11771
|
declare abstract class Watching {
|
11746
11772
|
startTime: null | number;
|