updated npm modules
This commit is contained in:
15
node_modules/webpack/lib/MainTemplate.js
generated
vendored
15
node_modules/webpack/lib/MainTemplate.js
generated
vendored
@@ -98,6 +98,8 @@ module.exports = class MainTemplate extends Tapable {
|
||||
beforeStartup: new SyncWaterfallHook(["source", "chunk", "hash"]),
|
||||
/** @type {SyncWaterfallHook<string, Chunk, string>} */
|
||||
startup: new SyncWaterfallHook(["source", "chunk", "hash"]),
|
||||
/** @type {SyncWaterfallHook<string, Chunk, string>} */
|
||||
afterStartup: new SyncWaterfallHook(["source", "chunk", "hash"]),
|
||||
render: new SyncWaterfallHook([
|
||||
"source",
|
||||
"chunk",
|
||||
@@ -404,7 +406,20 @@ module.exports = class MainTemplate extends Tapable {
|
||||
);
|
||||
buf.push("");
|
||||
buf.push(Template.asString(this.hooks.beforeStartup.call("", chunk, hash)));
|
||||
const afterStartupCode = Template.asString(
|
||||
this.hooks.afterStartup.call("", chunk, hash)
|
||||
);
|
||||
if (afterStartupCode) {
|
||||
// TODO webpack 5: this is a bit hacky to avoid a breaking change
|
||||
// change it to a better way
|
||||
buf.push("var startupResult = (function() {");
|
||||
}
|
||||
buf.push(Template.asString(this.hooks.startup.call("", chunk, hash)));
|
||||
if (afterStartupCode) {
|
||||
buf.push("})();");
|
||||
buf.push(afterStartupCode);
|
||||
buf.push("return startupResult;");
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user