updated npm modules

This commit is contained in:
2019-05-20 20:43:45 -05:00
parent 2319197b81
commit f166b72b7d
1113 changed files with 8758 additions and 12227 deletions

View File

@@ -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;
}