Socket
Socket
Sign inDemoInstall

webpack

Package Overview
Dependencies
76
Maintainers
4
Versions
832
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.89.0 to 5.90.0

lib/dependencies/ExternalModuleDependency.js

4

bin/webpack.js

@@ -79,7 +79,6 @@ #!/usr/bin/env node

const pkgPath = require.resolve(`${cli.package}/package.json`);
// eslint-disable-next-line node/no-missing-require
const pkg = require(pkgPath);
if (pkg.type === "module" || /\.mjs/i.test(pkg.bin[cli.binName])) {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
// eslint-disable-next-line n/no-unsupported-features/es-syntax
import(path.resolve(path.dirname(pkgPath), pkg.bin[cli.binName])).catch(

@@ -92,3 +91,2 @@ error => {

} else {
// eslint-disable-next-line node/no-missing-require
require(path.resolve(path.dirname(pkgPath), pkg.bin[cli.binName]));

@@ -95,0 +93,0 @@ }

@@ -48,7 +48,5 @@ /** @typedef {"info" | "warning" | "error"} LogLevel */

/* eslint-disable node/no-unsupported-features/node-builtins */
var group = console.group || dummy;
var groupCollapsed = console.groupCollapsed || dummy;
var groupEnd = console.groupEnd || dummy;
/* eslint-enable node/no-unsupported-features/node-builtins */

@@ -55,0 +53,0 @@ module.exports.group = logGroup(group);

@@ -250,3 +250,3 @@ /*

parser.state.module.layer
)
)
).setRange(expr.range)

@@ -253,0 +253,0 @@ );

@@ -211,5 +211,4 @@ /*

} catch (e) {
/** @type {Error} */ (
e
).message += `\nduring rendering of asset ${module.identifier()}`;
/** @type {Error} */ (e).message +=
`\nduring rendering of asset ${module.identifier()}`;
throw e;

@@ -216,0 +215,0 @@ }

@@ -14,6 +14,8 @@ /*

* @param {Iterable<string | RegExp>} immutablePaths list of immutable paths
* @param {Iterable<string | RegExp>} unmanagedPaths list of unmanaged paths
*/
constructor(managedPaths, immutablePaths) {
constructor(managedPaths, immutablePaths, unmanagedPaths) {
this.managedPaths = new Set(managedPaths);
this.immutablePaths = new Set(immutablePaths);
this.unmanagedPaths = new Set(unmanagedPaths);
}

@@ -33,2 +35,5 @@

}
for (const unmanagedPath of this.unmanagedPaths) {
compiler.unmanagedPaths.add(unmanagedPath);
}
}

@@ -35,0 +40,0 @@ }

@@ -202,7 +202,14 @@ /*

}
idleTimer = setTimeout(() => {
idleTimer = undefined;
isIdle = true;
resolvedPromise.then(processIdleTasks);
}, Math.min(isInitialStore ? idleTimeoutForInitialStore : Infinity, isLargeChange ? idleTimeoutAfterLargeChanges : Infinity, idleTimeout));
idleTimer = setTimeout(
() => {
idleTimer = undefined;
isIdle = true;
resolvedPromise.then(processIdleTasks);
},
Math.min(
isInitialStore ? idleTimeoutForInitialStore : Infinity,
isLargeChange ? idleTimeoutAfterLargeChanges : Infinity,
idleTimeout
)
);
idleTimer.unref();

@@ -209,0 +216,0 @@ }

@@ -542,3 +542,3 @@ /*

return new PackContentItems(map);
})
})
: undefined;

@@ -1050,4 +1050,4 @@ }

: compression === "gzip"
? ".pack.gz"
: ".pack";
? ".pack.gz"
: ".pack";
this.snapshot = snapshot;

@@ -1054,0 +1054,0 @@ /** @type {Set<string>} */

@@ -267,3 +267,3 @@ /*

}
}
}
: (err, result) => {

@@ -280,3 +280,3 @@ if (callbacks === undefined) {

}
};
};
/**

@@ -283,0 +283,0 @@ * @param {Error=} err error if any

@@ -1542,3 +1542,3 @@ /*

`0x${this._getModuleGraphHashWithConnections(cgm, module, runtime)}`
)
)
: this._getModuleGraphHashBigInt(cgm, module, runtime);

@@ -1545,0 +1545,0 @@ }

@@ -331,14 +331,14 @@ /*

: typeof keep === "string"
? /**
* @param {string} path path
* @returns {boolean} true, if the path should be kept
*/
path => path.startsWith(keep)
: typeof keep === "object" && keep.test
? /**
* @param {string} path path
* @returns {boolean} true, if the path should be kept
*/
path => keep.test(path)
: () => false;
? /**
* @param {string} path path
* @returns {boolean} true, if the path should be kept
*/
path => path.startsWith(keep)
: typeof keep === "object" && keep.test
? /**
* @param {string} path path
* @returns {boolean} true, if the path should be kept
*/
path => keep.test(path)
: () => false;

@@ -345,0 +345,0 @@ // We assume that no external modification happens while the compiler is active

@@ -231,2 +231,4 @@ /*

/** @type {Set<string | RegExp>} */
this.unmanagedPaths = new Set();
/** @type {Set<string | RegExp>} */
this.immutablePaths = new Set();

@@ -385,2 +387,13 @@

if (this._lastCompilation !== undefined) {
for (const childCompilation of this._lastCompilation.children) {
for (const module of childCompilation.modules) {
ChunkGraph.clearChunkGraphForModule(module);
ModuleGraph.clearModuleGraphForModule(module);
module.cleanupForCache();
}
for (const chunk of childCompilation.chunks) {
ChunkGraph.clearChunkGraphForChunk(chunk);
}
}
for (const module of this._lastCompilation.modules) {

@@ -387,0 +400,0 @@ ChunkGraph.clearChunkGraphForModule(module);

@@ -117,4 +117,4 @@ /*

: asiSafe === false
? "_asiSafe0"
: "";
? "_asiSafe0"
: "";
const exportData = ids

@@ -121,0 +121,0 @@ ? Buffer.from(JSON.stringify(ids), "utf-8").toString("hex")

@@ -63,7 +63,7 @@ /*

: configPath
? browserslist.loadConfig({
config: configPath,
env
})
: browserslist.loadConfig({ path: context, env });
? browserslist.loadConfig({
config: configPath,
env
})
: browserslist.loadConfig({ path: context, env });

@@ -314,2 +314,21 @@ if (!config) return;

}),
asyncFunction: rawChecker({
chrome: 55,
and_chr: 55,
edge: 15,
firefox: 52,
and_ff: 52,
// ie: Not supported,
opera: 42,
op_mob: 42,
safari: [10, 1],
ios_saf: [10, 3],
samsung: 6,
android: 55,
// and_qq: Unknown support
// baidu: Unknown support
// and_uc: Unknown support
// kaios: Unknown support
node: [7, 6]
}),
browser: browserProperty,

@@ -316,0 +335,0 @@ electron: false,

@@ -32,3 +32,4 @@ /*

/** @typedef {import("../../declarations/WebpackOptions").Context} Context */
/** @typedef {import("../../declarations/WebpackOptions").CssExperimentOptions} CssExperimentOptions */
/** @typedef {import("../../declarations/WebpackOptions").CssGeneratorOptions} CssGeneratorOptions */
/** @typedef {import("../../declarations/WebpackOptions").CssParserOptions} CssParserOptions */
/** @typedef {import("../../declarations/WebpackOptions").EntryDescription} EntryDescription */

@@ -43,2 +44,3 @@ /** @typedef {import("../../declarations/WebpackOptions").EntryNormalized} Entry */

/** @typedef {import("../../declarations/WebpackOptions").FileCacheOptions} FileCacheOptions */
/** @typedef {import("../../declarations/WebpackOptions").GeneratorOptionsByModuleTypeKnown} GeneratorOptionsByModuleTypeKnown */
/** @typedef {import("../../declarations/WebpackOptions").InfrastructureLogging} InfrastructureLogging */

@@ -164,7 +166,7 @@ /** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */

: typeof target === "string"
? getTargetProperties(target, /** @type {Context} */ (options.context))
: getTargetsProperties(
/** @type {string[]} */ (target),
/** @type {Context} */ (options.context)
);
? getTargetProperties(target, /** @type {Context} */ (options.context))
: getTargetsProperties(
/** @type {string[]} */ (target),
/** @type {Context} */ (options.context)
);

@@ -229,3 +231,4 @@ const development = mode === "development";

futureDefaults,
isNode: targetProperties && targetProperties.node === true
isNode: targetProperties && targetProperties.node === true,
targetProperties
});

@@ -267,4 +270,4 @@

: options.output.module
? "module"
: "var";
? "module"
: "var";
});

@@ -276,2 +279,3 @@

(options.experiments.futureDefaults),
outputModule: options.output.module,
targetProperties

@@ -344,3 +348,3 @@ });

D(experiments, "cacheUnaffected", experiments.futureDefaults);
F(experiments, "css", () => (experiments.futureDefaults ? {} : undefined));
F(experiments, "css", () => (experiments.futureDefaults ? true : undefined));

@@ -358,10 +362,2 @@ // TODO webpack 6: remove this. topLevelAwait should be enabled by default

}
if (typeof experiments.css === "object") {
D(
experiments.css,
"exportsOnly",
!targetProperties || !targetProperties.document
);
}
};

@@ -459,3 +455,3 @@

/^(.+?(?:[\\/]\.yarn[\\/]unplugged[\\/][^\\/]+)?[\\/]node_modules[\\/])/
]
]
: [/^(.+?[\\/]node_modules[\\/])/]

@@ -480,3 +476,2 @@ );

const match = /^(.+?[\\/]node_modules[\\/])/.exec(
// eslint-disable-next-line node/no-extraneous-require
require.resolve("watchpack")

@@ -557,2 +552,19 @@ );

/**
* @param {CssGeneratorOptions} generatorOptions generator options
* @param {Object} options options
* @param {TargetProperties | false} options.targetProperties target properties
* @returns {void}
*/
const applyCssGeneratorOptionsDefaults = (
generatorOptions,
{ targetProperties }
) => {
D(
generatorOptions,
"exportsOnly",
!targetProperties || !targetProperties.document
);
};
/**
* @param {ModuleOptions} module options

@@ -563,5 +575,6 @@ * @param {Object} options options

* @param {boolean} options.asyncWebAssembly is asyncWebAssembly enabled
* @param {CssExperimentOptions|false} options.css is css enabled
* @param {boolean} options.css is css enabled
* @param {boolean} options.futureDefaults is future defaults enabled
* @param {boolean} options.isNode is node target platform
* @param {TargetProperties | false} options.targetProperties target properties
* @returns {void}

@@ -571,3 +584,11 @@ */

module,
{ cache, syncWebAssembly, asyncWebAssembly, css, futureDefaults, isNode }
{
cache,
syncWebAssembly,
asyncWebAssembly,
css,
futureDefaults,
isNode,
targetProperties
}
) => {

@@ -623,2 +644,16 @@ if (cache) {

if (css) {
F(module.parser, "css", () => ({}));
D(module.parser.css, "namedExports", true);
F(module.generator, "css", () => ({}));
applyCssGeneratorOptionsDefaults(
/** @type {NonNullable<GeneratorOptionsByModuleTypeKnown["css"]>} */
(module.generator.css),
{ targetProperties }
);
}
A(module, "defaultRules", () => {

@@ -835,5 +870,4 @@ const esm = {

/** @type {Error & { code: string }} */
(
e
).message += `\nwhile determining default 'output.uniqueName' from 'name' in ${pkgPath}`;
(e).message +=
`\nwhile determining default 'output.uniqueName' from 'name' in ${pkgPath}`;
throw e;

@@ -888,18 +922,7 @@ }

D(output, "charset", true);
F(output, "hotUpdateGlobal", () =>
Template.toIdentifier(
"webpackHotUpdate" +
Template.toIdentifier(
/** @type {NonNullable<Output["uniqueName"]>} */ (output.uniqueName)
)
)
const uniqueNameId = Template.toIdentifier(
/** @type {NonNullable<Output["uniqueName"]>} */ (output.uniqueName)
);
F(output, "chunkLoadingGlobal", () =>
Template.toIdentifier(
"webpackChunk" +
Template.toIdentifier(
/** @type {NonNullable<Output["uniqueName"]>} */ (output.uniqueName)
)
)
);
F(output, "hotUpdateGlobal", () => "webpackHotUpdate" + uniqueNameId);
F(output, "chunkLoadingGlobal", () => "webpackChunk" + uniqueNameId);
F(output, "globalObject", () => {

@@ -1033,2 +1056,3 @@ if (tp) {

D(output, "hashDigestLength", futureDefaults ? 16 : 20);
D(output, "strictModuleErrorHandling", false);
D(output, "strictModuleExceptionHandling", false);

@@ -1072,2 +1096,8 @@

environment,
"asyncFunction",
() =>
tp && optimistic(/** @type {boolean | undefined} */ (tp.asyncFunction))
);
F(
environment,
"forOf",

@@ -1277,5 +1307,9 @@ () => tp && optimistic(/** @type {boolean | undefined} */ (tp.forOf))

* @param {boolean} options.futureDefaults is future defaults enabled
* @param {boolean} options.outputModule is output type is module
* @returns {void}
*/
const applyNodeDefaults = (node, { futureDefaults, targetProperties }) => {
const applyNodeDefaults = (
node,
{ futureDefaults, outputModule, targetProperties }
) => {
if (node === false) return;

@@ -1288,12 +1322,12 @@

});
F(node, "__filename", () => {
if (targetProperties && targetProperties.node) return "eval-only";
const handlerForNames = () => {
if (targetProperties && targetProperties.node)
return outputModule ? "node-module" : "eval-only";
// TODO webpack 6 should always default to false
return futureDefaults ? "warn-mock" : "mock";
});
F(node, "__dirname", () => {
if (targetProperties && targetProperties.node) return "eval-only";
// TODO webpack 6 should always default to false
return futureDefaults ? "warn-mock" : "mock";
});
};
F(node, "__filename", handlerForNames);
F(node, "__dirname", handlerForNames);
};

@@ -1319,3 +1353,3 @@

* @param {boolean} options.development is development
* @param {CssExperimentOptions|false} options.css is css enabled
* @param {boolean} options.css is css enabled
* @param {boolean} options.records using records

@@ -1414,3 +1448,3 @@ * @returns {void}

* @param {Mode} options.mode mode
* @param {CssExperimentOptions|false} options.css is css enabled
* @param {boolean} options.css is css enabled
* @returns {ResolveOptions} resolve options

@@ -1506,3 +1540,4 @@ */

conditionNames: styleConditions,
extensions: [".css"]
extensions: [".css"],
preferRelative: true
};

@@ -1509,0 +1544,0 @@ }

@@ -112,3 +112,3 @@ /*

/** @type {Record<string, R>} */ ({})
);
);
if (customKeys) {

@@ -179,5 +179,6 @@ for (const key of Object.keys(customKeys)) {

dependencies: config.dependencies,
devServer: optionalNestedConfig(config.devServer, devServer => ({
...devServer
})),
devServer: optionalNestedConfig(config.devServer, devServer => {
if (devServer === false) return false;
return { ...devServer };
}),
devtool: config.devtool,

@@ -188,7 +189,7 @@ entry:

: typeof config.entry === "function"
? (
fn => () =>
Promise.resolve().then(fn).then(getNormalizedEntryStatic)
)(config.entry)
: getNormalizedEntryStatic(config.entry),
? (
fn => () =>
Promise.resolve().then(fn).then(getNormalizedEntryStatic)
)(config.entry)
: getNormalizedEntryStatic(config.entry),
experiments: nestedConfig(config.experiments, experiments => ({

@@ -202,5 +203,2 @@ ...experiments,

options => (options === true ? {} : options)
),
css: optionalNestedConfig(experiments.css, options =>
options === true ? {} : options
)

@@ -234,3 +232,3 @@ })),

};
})
})
: undefined,

@@ -300,3 +298,3 @@ infrastructureLogging: cloneObject(config.infrastructureLogging),

optimization.emitOnErrors
)
)
: optimization.emitOnErrors

@@ -315,6 +313,6 @@ };

: libraryAsName || output.libraryTarget
? /** @type {LibraryOptions} */ ({
name: libraryAsName
})
: undefined;
? /** @type {LibraryOptions} */ ({
name: libraryAsName
})
: undefined;
/** @type {OutputNormalized} */

@@ -392,2 +390,3 @@ const result = {

sourcePrefix: output.sourcePrefix,
strictModuleErrorHandling: output.strictModuleErrorHandling,
strictModuleExceptionHandling: output.strictModuleExceptionHandling,

@@ -394,0 +393,0 @@ trustedTypes: optionalNestedConfig(

@@ -64,2 +64,3 @@ /*

* @property {boolean | null} templateLiteral template literal is available
* @property {boolean | null} asyncFunction async functions and await are available
*/

@@ -196,2 +197,3 @@

arrowFunction: v(6),
asyncFunction: v(7, 6),
forOf: v(5),

@@ -238,2 +240,3 @@ destructuring: v(6),

arrowFunction: v(1, 1),
asyncFunction: v(1, 7),
forOf: v(0, 36),

@@ -276,2 +279,3 @@ destructuring: v(1, 1),

arrowFunction: v(0, 15),
asyncFunction: v(0, 21),
forOf: v(0, 13),

@@ -301,2 +305,3 @@ destructuring: v(0, 15),

module: v >= 2015,
asyncFunction: v >= 2017,
globalThis: v >= 2020,

@@ -303,0 +308,0 @@ bigIntLiteral: v >= 2020,

@@ -116,3 +116,3 @@ /*

i ? `/fallback-${i}` : ""
}`
}`
),

@@ -119,0 +119,0 @@ `.${data.request.slice(key.length)}`,

@@ -512,4 +512,4 @@ /*

: typeof this.options.resource === "string"
? [this.options.resource]
: /** @type {string[]} */ (this.options.resource),
? [this.options.resource]
: /** @type {string[]} */ (this.options.resource),
null,

@@ -951,4 +951,4 @@ SNAPSHOT_OPTIONS,

: hasMultipleOrNoChunks
? `Promise.all(ids.slice(${chunksStartPosition}).map(${RuntimeGlobals.ensureChunk}))`
: `${RuntimeGlobals.ensureChunk}(ids[${chunksStartPosition}])`;
? `Promise.all(ids.slice(${chunksStartPosition}).map(${RuntimeGlobals.ensureChunk}))`
: `${RuntimeGlobals.ensureChunk}(ids[${chunksStartPosition}])`;
const returnModuleObject = this.getReturnModuleObjectSource(

@@ -955,0 +955,0 @@ fakeMap,

@@ -163,3 +163,3 @@ /*

dependencies[0].category
)
)
: resolveOptions

@@ -166,0 +166,0 @@ );

@@ -50,2 +50,3 @@ /*

let chunkInitFragments;
const runtimeRequirements = new Set();

@@ -64,3 +65,15 @@

initFragments,
cssExports
cssExports,
get chunkInitFragments() {
if (!chunkInitFragments) {
const data = generateContext.getData();
chunkInitFragments = data.get("chunkInitFragments");
if (!chunkInitFragments) {
chunkInitFragments = [];
data.set("chunkInitFragments", chunkInitFragments);
}
}
return chunkInitFragments;
}
};

@@ -67,0 +80,0 @@

@@ -41,2 +41,3 @@ /*

let chunkInitFragments;
const templateContext = {

@@ -53,3 +54,15 @@ runtimeTemplate: generateContext.runtimeTemplate,

initFragments,
cssExports
cssExports,
get chunkInitFragments() {
if (!chunkInitFragments) {
const data = generateContext.getData();
chunkInitFragments = data.get("chunkInitFragments");
if (!chunkInitFragments) {
chunkInitFragments = [];
data.set("chunkInitFragments", chunkInitFragments);
}
}
return chunkInitFragments;
}
};

@@ -56,0 +69,0 @@

@@ -132,3 +132,3 @@ /*

"}"
])
])
: ""

@@ -145,3 +145,3 @@ ]);

{ expr: "chunkId" }
)
)
: runtimeTemplate.concatenation("--webpack-", { expr: "chunkId" });

@@ -163,3 +163,3 @@

runtimeTemplate.outputOptions.uniqueName
)};`
)};`
: "// data-webpack is not used as build has no uniqueName",

@@ -216,6 +216,6 @@ `var loadCssChunkData = ${runtimeTemplate.basicFunction(

{ expr: "exports[x]" }
)
)
: runtimeTemplate.concatenation({ expr: "token" }, "-", {
expr: "exports[x]"
})
})
}`,

@@ -299,14 +299,14 @@ "x"

Array.from(initialChunkIdsWithCss)
)}.forEach(loadCssChunkData.bind(null, ${
)}.forEach(loadCssChunkData.bind(null, ${
RuntimeGlobals.moduleFactories
}, 0));`
}, 0));`
: initialChunkIdsWithCss.size > 0
? `${Array.from(
initialChunkIdsWithCss,
id =>
`loadCssChunkData(${
RuntimeGlobals.moduleFactories
}, 0, ${JSON.stringify(id)});`
).join("")}`
: "// no initial css",
? `${Array.from(
initialChunkIdsWithCss,
id =>
`loadCssChunkData(${
RuntimeGlobals.moduleFactories
}, 0, ${JSON.stringify(id)});`
).join("")}`
: "// no initial css",
"",

@@ -353,7 +353,7 @@ withLoading

"var errorType = event && event.type;",
"var realSrc = event && event.target && event.target.src;",
"error.message = 'Loading css chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';",
"var realHref = event && event.target && event.target.href;",
"error.message = 'Loading css chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realHref + ')';",
"error.name = 'ChunkLoadError';",
"error.type = errorType;",
"error.request = realSrc;",
"error.request = realHref;",
"installedChunkData[1](error);"

@@ -381,3 +381,3 @@ ]),

])};`
])
])
: "// no chunk loading",

@@ -445,7 +445,7 @@ "",

"var errorType = event && event.type;",
"var realSrc = event && event.target && event.target.src;",
"error.message = 'Loading css hot update chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';",
"var realHref = event && event.target && event.target.href;",
"error.message = 'Loading css hot update chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realHref + ')';",
"error.name = 'ChunkLoadError';",
"error.type = errorType;",
"error.request = realSrc;",
"error.request = realHref;",
"reject(error);"

@@ -475,3 +475,3 @@ ]),

)}`
])
])
: "// no hmr"

@@ -478,0 +478,0 @@ ]);

@@ -36,3 +36,2 @@ /*

/** @typedef {import("webpack-sources").Source} Source */
/** @typedef {import("../../declarations/WebpackOptions").CssExperimentOptions} CssExperimentOptions */
/** @typedef {import("../../declarations/WebpackOptions").Output} OutputOptions */

@@ -63,19 +62,56 @@ /** @typedef {import("../Chunk")} Chunk */

const validateGeneratorOptions = createSchemaValidation(
require("../../schemas/plugins/css/CssGeneratorOptions.check.js"),
() => getSchema("CssGeneratorOptions"),
{
name: "Css Modules Plugin",
baseDataPath: "parser"
}
);
const validateParserOptions = createSchemaValidation(
require("../../schemas/plugins/css/CssParserOptions.check.js"),
() => getSchema("CssParserOptions"),
{
name: "Css Modules Plugin",
baseDataPath: "parser"
}
);
const generatorValidationOptions = {
name: "Css Modules Plugin",
baseDataPath: "generator"
};
const validateGeneratorOptions = {
css: createSchemaValidation(
require("../../schemas/plugins/css/CssGeneratorOptions.check.js"),
() => getSchema("CssGeneratorOptions"),
generatorValidationOptions
),
"css/auto": createSchemaValidation(
require("../../schemas/plugins/css/CssAutoGeneratorOptions.check.js"),
() => getSchema("CssAutoGeneratorOptions"),
generatorValidationOptions
),
"css/module": createSchemaValidation(
require("../../schemas/plugins/css/CssModuleGeneratorOptions.check.js"),
() => getSchema("CssModuleGeneratorOptions"),
generatorValidationOptions
),
"css/global": createSchemaValidation(
require("../../schemas/plugins/css/CssGlobalGeneratorOptions.check.js"),
() => getSchema("CssGlobalGeneratorOptions"),
generatorValidationOptions
)
};
const parserValidationOptions = {
name: "Css Modules Plugin",
baseDataPath: "parser"
};
const validateParserOptions = {
css: createSchemaValidation(
require("../../schemas/plugins/css/CssParserOptions.check.js"),
() => getSchema("CssParserOptions"),
parserValidationOptions
),
"css/auto": createSchemaValidation(
require("../../schemas/plugins/css/CssAutoParserOptions.check.js"),
() => getSchema("CssAutoParserOptions"),
parserValidationOptions
),
"css/module": createSchemaValidation(
require("../../schemas/plugins/css/CssModuleParserOptions.check.js"),
() => getSchema("CssModuleParserOptions"),
parserValidationOptions
),
"css/global": createSchemaValidation(
require("../../schemas/plugins/css/CssGlobalParserOptions.check.js"),
() => getSchema("CssGlobalParserOptions"),
parserValidationOptions
)
};
/**

@@ -101,8 +137,2 @@ * @param {string} str string

/**
* @param {CssExperimentOptions} options options
*/
constructor({ exportsOnly = false }) {
this._exportsOnly = exportsOnly;
}
/**
* Apply the plugin

@@ -162,3 +192,4 @@ * @param {Compiler} compiler the compiler instance

.tap(plugin, parserOptions => {
validateParserOptions(parserOptions);
validateParserOptions[type](parserOptions);
const { namedExports } = parserOptions;

@@ -168,10 +199,14 @@ switch (type) {

case CSS_MODULE_TYPE_AUTO:
return new CssParser();
return new CssParser({
namedExports
});
case CSS_MODULE_TYPE_GLOBAL:
return new CssParser({
allowModeSwitch: false
allowModeSwitch: false,
namedExports
});
case CSS_MODULE_TYPE_MODULE:
return new CssParser({
defaultMode: "local"
defaultMode: "local",
namedExports
});

@@ -183,4 +218,5 @@ }

.tap(plugin, generatorOptions => {
validateGeneratorOptions(generatorOptions);
return this._exportsOnly
validateGeneratorOptions[type](generatorOptions);
return generatorOptions.exportsOnly
? new CssExportsGenerator()

@@ -598,5 +634,5 @@ : new CssGenerator();

: v === "--" + shortcutValue
? `${escapeCss(n)}%`
: `${escapeCss(n)}(${escapeCss(v)})`;
}).join("")
? `${escapeCss(n)}%`
: `${escapeCss(n)}(${escapeCss(v)})`;
}).join("")
: ""

@@ -603,0 +639,0 @@ }${escapeCss(moduleId)}`

@@ -134,6 +134,11 @@ /*

class CssParser extends Parser {
constructor({ allowModeSwitch = true, defaultMode = "global" } = {}) {
constructor({
allowModeSwitch = true,
defaultMode = "global",
namedExports = true
} = {}) {
super();
this.allowModeSwitch = allowModeSwitch;
this.defaultMode = defaultMode;
this.namedExports = namedExports;
}

@@ -915,3 +920,3 @@

? /** @type {"local" | "global"} */
(balanced[balanced.length - 1][0])
(balanced[balanced.length - 1][0])
: undefined;

@@ -1029,3 +1034,3 @@ const dep = new ConstDependency("", [start, end]);

module.buildInfo.strict = true;
module.buildMeta.exportsType = "namespace";
module.buildMeta.exportsType = this.namedExports ? "namespace" : "default";
module.addDependency(new StaticExportsDependency([], true));

@@ -1032,0 +1037,0 @@ return state;

@@ -34,3 +34,3 @@ /*

try {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
// eslint-disable-next-line n/no-unsupported-features/node-builtins
inspector = require("inspector");

@@ -378,3 +378,3 @@ } catch (e) {

fn
});
});
return {

@@ -381,0 +381,0 @@ ...tapInfo,

@@ -42,2 +42,9 @@ /*

/**
* @returns {string} hash update
*/
_createHashUpdate() {
return `${this.identifier}${this.range}${this.expression}`;
}
/**
* Update the hash

@@ -50,3 +57,3 @@ * @param {Hash} hash hash to be updated

if (this._hashUpdate === undefined)
this._hashUpdate = "" + this.identifier + this.range + this.expression;
this._hashUpdate = this._createHashUpdate();
hash.update(this._hashUpdate);

@@ -53,0 +60,0 @@ }

@@ -68,3 +68,3 @@ /*

/**
* @param {TODO} expression expression
* @param {string} expression expression
* @param {() => string[]} getMembers get members

@@ -71,0 +71,0 @@ */

@@ -69,3 +69,3 @@ /*

canMangle: false
}))
}))
: Dependency.EXPORTS_OBJECT_REFERENCED;

@@ -72,0 +72,0 @@ }

@@ -94,3 +94,3 @@ /*

referencedModule
)
)
: false

@@ -97,0 +97,0 @@ };

@@ -8,2 +8,3 @@ /*

const EnvironmentNotSupportAsyncWarning = require("../EnvironmentNotSupportAsyncWarning");
const { JAVASCRIPT_MODULE_TYPE_ESM } = require("../ModuleTypeConstants");

@@ -69,3 +70,3 @@ const DynamicExports = require("./DynamicExports");

throw new Error(
"The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)"
"The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enable it)"
);

@@ -80,2 +81,7 @@ }

(module.buildMeta).async = true;
EnvironmentNotSupportAsyncWarning.check(
module,
parser.state.compilation.runtimeTemplate,
"topLevelAwait"
);
});

@@ -82,0 +88,0 @@

@@ -34,6 +34,6 @@ /*

: options.exportsPresence !== undefined
? ExportPresenceModes.fromUserOption(options.exportsPresence)
: options.strictExportPresence
? ExportPresenceModes.ERROR
: ExportPresenceModes.AUTO;
? ExportPresenceModes.fromUserOption(options.exportsPresence)
: options.strictExportPresence
? ExportPresenceModes.ERROR
: ExportPresenceModes.AUTO;
}

@@ -101,16 +101,16 @@

: isFunctionDeclaration
? {
id: expr.id ? expr.id.name : undefined,
range: [
expr.range[0],
expr.params.length > 0
? expr.params[0].range[0]
: expr.body.range[0]
],
prefix: `${expr.async ? "async " : ""}function${
expr.generator ? "*" : ""
} `,
suffix: `(${expr.params.length > 0 ? "" : ") "}`
}
: undefined
? {
id: expr.id ? expr.id.name : undefined,
range: [
expr.range[0],
expr.params.length > 0
? expr.params[0].range[0]
: expr.body.range[0]
],
prefix: `${expr.async ? "async " : ""}function${
expr.generator ? "*" : ""
} `,
suffix: `(${expr.params.length > 0 ? "" : ") "}`
}
: undefined
);

@@ -117,0 +117,0 @@ dep.loc = Object.create(statement.loc);

@@ -144,6 +144,6 @@ /*

this.unusedExports
)} */\n`
)} */\n`
: this.unusedExports.size > 0
? `/* unused harmony export ${first(this.unusedExports)} */\n`
: "";
? `/* unused harmony export ${first(this.unusedExports)} */\n`
: "";
const definitions = [];

@@ -164,3 +164,3 @@ const orderedExportMap = Array.from(this.exportMap).sort(([a], [b]) =>

this.exportsArgument
}, {${definitions.join(",")}\n/* harmony export */ });\n`
}, {${definitions.join(",")}\n/* harmony export */ });\n`
: "";

@@ -167,0 +167,0 @@ return `${definePart}${unusedPart}`;

@@ -160,4 +160,4 @@ /*

: providedExports.length === 0
? " (module has no exports)"
: ` (possible exports: ${providedExports.join(", ")})`;
? " (module has no exports)"
: ` (possible exports: ${providedExports.join(", ")})`;
return [

@@ -291,4 +291,4 @@ new HarmonyLinkingError(

: connection
? filterRuntime(runtime, r => connection.isTargetActive(r))
: true;
? filterRuntime(runtime, r => connection.isTargetActive(r))
: true;

@@ -295,0 +295,0 @@ if (module && referencedModule) {

@@ -78,6 +78,6 @@ /*

: options.exportsPresence !== undefined
? ExportPresenceModes.fromUserOption(options.exportsPresence)
: options.strictExportPresence
? ExportPresenceModes.ERROR
: ExportPresenceModes.AUTO;
? ExportPresenceModes.fromUserOption(options.exportsPresence)
: options.strictExportPresence
? ExportPresenceModes.ERROR
: ExportPresenceModes.AUTO;
this.strictThisContextOnImports = options.strictThisContextOnImports;

@@ -244,3 +244,3 @@ }

members.length - nonOptionalMembers.length
)
)
: expression;

@@ -291,3 +291,3 @@ const ids = settings.ids.concat(nonOptionalMembers);

members.length - nonOptionalMembers.length
)
)
: callee;

@@ -294,0 +294,0 @@ const ids = settings.ids.concat(nonOptionalMembers);

@@ -51,8 +51,28 @@ /*

getReferencedExports(moduleGraph, runtime) {
return this.referencedExports
? this.referencedExports.map(e => ({
name: e,
canMangle: false
}))
: Dependency.EXPORTS_OBJECT_REFERENCED;
if (!this.referencedExports) return Dependency.EXPORTS_OBJECT_REFERENCED;
const refs = [];
for (const referencedExport of this.referencedExports) {
if (referencedExport[0] === "default") {
const selfModule = moduleGraph.getParentModule(this);
const importedModule =
/** @type {Module} */
(moduleGraph.getModule(this));
const exportsType = importedModule.getExportsType(
moduleGraph,
/** @type {BuildMeta} */
(selfModule.buildMeta).strictHarmonyModule
);
if (
exportsType === "default-only" ||
exportsType === "default-with-named"
) {
return Dependency.EXPORTS_OBJECT_REFERENCED;
}
}
refs.push({
name: referencedExport,
canMangle: false
});
}
return refs;
}

@@ -59,0 +79,0 @@

@@ -31,3 +31,3 @@ /*

};
})
})
: undefined;

@@ -34,0 +34,0 @@ } else {

@@ -188,3 +188,4 @@ /*

context: loaderContext.context,
connectOrigin: false
connectOrigin: false,
checkCycle: true
},

@@ -191,0 +192,0 @@ err => {

@@ -10,3 +10,3 @@ /*

const makeSerializable = require("../util/makeSerializable");
const { filterRuntime } = require("../util/runtime");
const { filterRuntime, deepMergeRuntime } = require("../util/runtime");
const NullDependency = require("./NullDependency");

@@ -97,3 +97,10 @@

source,
{ chunkGraph, moduleGraph, runtime, runtimeTemplate, runtimeRequirements }
{
chunkGraph,
moduleGraph,
runtime,
runtimes,
runtimeTemplate,
runtimeRequirements
}
) {

@@ -106,3 +113,4 @@ const dep = /** @type {PureExpressionDependency} */ (dependency);

const exportsInfo = moduleGraph.getExportsInfo(selfModule);
const runtimeCondition = filterRuntime(runtime, runtime => {
const merged = deepMergeRuntime(runtimes, runtime);
const runtimeCondition = filterRuntime(merged, runtime => {
for (const exportName of usedByExports) {

@@ -119,3 +127,3 @@ if (exportsInfo.getUsed(exportName, runtime) !== UsageState.Unused) {

chunkGraph,
runtime,
runtime: merged,
runtimeCondition,

@@ -122,0 +130,0 @@ runtimeRequirements

@@ -72,3 +72,3 @@ /*

)}`
)
)
: "";

@@ -75,0 +75,0 @@

@@ -74,3 +74,3 @@ /*

)}`
)
)
: "";

@@ -77,0 +77,0 @@

@@ -243,3 +243,3 @@ /*

: /** @type {Range} */ (arg1.range)[1]
};
};
const { options: importOptions, errors: commentErrors } =

@@ -433,2 +433,8 @@ parser.parseCommentOptions(/** @type {Range} */ (expr.range));

parser.hooks.preDeclarator.tap(PLUGIN_NAME, (decl, statement) => {
if (decl.id.type === "Identifier" && decl.id.name === pattern) {
parser.tagVariable(decl.id.name, WorkerSpecifierTag);
return true;
}
});
parser.hooks.pattern.for(pattern).tap(PLUGIN_NAME, pattern => {

@@ -435,0 +441,0 @@ parser.tagVariable(pattern.name, WorkerSpecifierTag);

@@ -29,6 +29,8 @@ /*

* @property {Module} module current module
* @property {RuntimeSpec} runtime current runtimes, for which code is generated
* @property {RuntimeSpec} runtime current runtime, for which code is generated
* @property {RuntimeSpec[]} [runtimes] current runtimes, for which code is generated
* @property {InitFragment<GenerateContext>[]} initFragments mutable array of init fragments for the current module
* @property {ConcatenationScope=} concatenationScope when in a concatenated module, information about other concatenated modules
* @property {CodeGenerationResults} codeGenerationResults the code generation results
* @property {InitFragment<GenerateContext>[]} chunkInitFragments chunkInitFragments
*/

@@ -35,0 +37,0 @@

@@ -175,3 +175,3 @@ /*

withOnChunkLoad ? `${RuntimeGlobals.onChunksLoaded}();` : ""
])}`
])}`
: "// no install chunk",

@@ -226,6 +226,6 @@ "",

"}"
])
])
: Template.indent(["installedChunks[chunkId] = 0;"])
)};`
])
])
: "// no chunk on demand loading",

@@ -236,3 +236,3 @@ "",

`${RuntimeGlobals.externalInstallChunk} = installChunk;`
])
])
: "// no external install chunk",

@@ -243,6 +243,6 @@ "",

RuntimeGlobals.onChunksLoaded
}.j = ${runtimeTemplate.returningFunction(
}.j = ${runtimeTemplate.returningFunction(
"installedChunks[chunkId] === 0",
"chunkId"
)};`
)};`
: "// no on chunks loaded"

@@ -249,0 +249,0 @@ ]);

@@ -85,3 +85,3 @@ /*

content + footer
)})`
)})`
: JSON.stringify(content + footer)

@@ -88,0 +88,0 @@ });`

@@ -185,3 +185,3 @@ /*

content + footer
)})`
)})`
: JSON.stringify(content + footer)

@@ -188,0 +188,0 @@ });`

@@ -51,3 +51,3 @@ /*

members[members.length - 1]
)
)
: new ExportsInfoDependency(

@@ -57,3 +57,3 @@ /** @type {Range} */ (expr.range),

members[0]
);
);
dep.loc = /** @type {DependencyLocation} */ (expr.loc);

@@ -60,0 +60,0 @@ parser.state.module.addDependency(dep);

@@ -10,2 +10,3 @@ /*

const ConcatenationScope = require("./ConcatenationScope");
const EnvironmentNotSupportAsyncWarning = require("./EnvironmentNotSupportAsyncWarning");
const { UsageState } = require("./ExportsInfo");

@@ -221,3 +222,8 @@ const InitFragment = require("./InitFragment");

const generateModuleRemapping = (input, exportsInfo, runtime) => {
const generateModuleRemapping = (
input,
exportsInfo,
runtime,
runtimeTemplate
) => {
if (exportsInfo.otherExportsInfo.getUsed(runtime) === UsageState.Unused) {

@@ -240,5 +246,5 @@ const properties = [];

properties.push(
`[${JSON.stringify(used)}]: () => ${input}${propertyAccess([
exportInfo.name
])}`
`[${JSON.stringify(used)}]: ${runtimeTemplate.returningFunction(
`${input}${propertyAccess([exportInfo.name])}`
)}`
);

@@ -254,3 +260,3 @@ }

* @param {RuntimeSpec} runtime the runtime
* @param {string | HashConstructor=} hashFunction the hash function to use
* @param {RuntimeTemplate} runtimeTemplate the runtime template
* @returns {SourceData} the generated source

@@ -262,3 +268,3 @@ */

runtime,
hashFunction
runtimeTemplate
) => {

@@ -270,3 +276,3 @@ if (!Array.isArray(moduleAndSpecifiers))

undefined,
hashFunction
runtimeTemplate.outputOptions.hashFunction
);

@@ -280,3 +286,4 @@ const baseAccess = `${initFragment.getNamespaceIdentifier()}${propertyAccess(

exportsInfo,
runtime
runtime,
runtimeTemplate
);

@@ -286,3 +293,9 @@ let expression = moduleRemapping || baseAccess;

expression,
init: `var x = y => { var x = {}; ${RuntimeGlobals.definePropertyGetters}(x, y); return x; }\nvar y = x => () => x`,
init: `var x = ${runtimeTemplate.basicFunction(
"y",
`var x = {}; ${RuntimeGlobals.definePropertyGetters}(x, y); return x`
)} \nvar y = ${runtimeTemplate.returningFunction(
runtimeTemplate.returningFunction("x"),
"x"
)}`,
runtimeRequirements: moduleRemapping

@@ -366,3 +379,3 @@ ? RUNTIME_REQUIREMENTS_FOR_MODULE

runtimeTemplate
)
)
: undefined,

@@ -503,2 +516,7 @@ expression: externalVariable

this.buildMeta.async = true;
EnvironmentNotSupportAsyncWarning.check(
this,
compilation.runtimeTemplate,
"external module"
);
if (!Array.isArray(request) || request.length === 1) {

@@ -511,7 +529,24 @@ this.buildMeta.exportsType = "namespace";

case "script":
this.buildMeta.async = true;
EnvironmentNotSupportAsyncWarning.check(
this,
compilation.runtimeTemplate,
"external script"
);
break;
case "promise":
this.buildMeta.async = true;
EnvironmentNotSupportAsyncWarning.check(
this,
compilation.runtimeTemplate,
"external promise"
);
break;
case "import":
this.buildMeta.async = true;
EnvironmentNotSupportAsyncWarning.check(
this,
compilation.runtimeTemplate,
"external import"
);
if (!Array.isArray(request) || request.length === 1) {

@@ -583,3 +618,3 @@ this.buildMeta.exportsType = "namespace";

runtimeTemplate.outputOptions.importMetaName
)
)
: getSourceForCommonJsExternal(request);

@@ -625,3 +660,3 @@ case "amd":

runtime,
runtimeTemplate.outputOptions.hashFunction
runtimeTemplate
);

@@ -628,0 +663,0 @@ }

@@ -195,3 +195,3 @@ /*

dependencyType
)
)
: data.resolveOptions

@@ -198,0 +198,0 @@ );

@@ -249,3 +249,3 @@ /*

priority
))
))
) {

@@ -252,0 +252,0 @@ changed = true;

@@ -30,2 +30,3 @@ /*

* @property {RuntimeSpec} runtime the runtime
* @property {RuntimeSpec[]} [runtimes] the runtimes
* @property {ConcatenationScope=} concatenationScope when in concatenated module, information about other concatenated modules

@@ -32,0 +33,0 @@ * @property {CodeGenerationResults=} codeGenerationResults code generation results of other modules (need to have a codeGenerationDependency to use that)

@@ -38,3 +38,2 @@ /*

// eslint-disable-next-line no-unused-vars
$hmrModuleData$ = currentModuleData;

@@ -100,4 +99,4 @@

}
fn.e = function (chunkId) {
return trackBlockingPromise(require.e(chunkId));
fn.e = function (chunkId, fetchPriority) {
return trackBlockingPromise(require.e(chunkId, fetchPriority));
};

@@ -294,4 +293,3 @@ return fn;

return promises;
},
[])
}, [])
).then(function () {

@@ -298,0 +296,0 @@ return waitForBlockingPromises(function () {

@@ -40,3 +40,3 @@ /*

return http.createServer.bind(http, options.server);
})();
})();
const listen =

@@ -50,3 +50,3 @@ typeof options.listen === "function"

server.listen(listen);
};
};

@@ -114,4 +114,4 @@ const protocol = options.protocol || (isHttps ? "https" : "http");

: addr.family === "IPv6"
? `${protocol}://[${addr.address}]:${addr.port}`
: `${protocol}://${addr.address}:${addr.port}`;
? `${protocol}://[${addr.address}]:${addr.port}`
: `${protocol}://${addr.address}:${addr.port}`;
logger.log(

@@ -118,0 +118,0 @@ `Server-Sent-Events server for lazy compilation open at ${urlBase}.`

@@ -450,3 +450,3 @@ /*

chunk.runtime
);
);
if (records.chunkModuleHashes[key] !== hash) {

@@ -575,3 +575,3 @@ updatedModules.add(module, chunk);

newRuntime
);
);
if (hash !== oldHash) {

@@ -740,3 +740,3 @@ if (module.type === WEBPACK_MODULE_TYPE_RUNTIME) {

)
)
)
};

@@ -743,0 +743,0 @@

@@ -69,3 +69,3 @@ /*

compilation.moduleGraph
),
),
(module, id) => {

@@ -72,0 +72,0 @@ const size = usedIds.size;

@@ -40,2 +40,3 @@ /*

/** @typedef {import("./Compiler").AssetEmittedInfo} AssetEmittedInfo */
/** @typedef {import("./MultiCompiler").MultiCompilerOptions} MultiCompilerOptions */
/** @typedef {import("./MultiStats")} MultiStats */

@@ -274,2 +275,5 @@ /** @typedef {import("./NormalModuleFactory").ResolveData} ResolveData */

},
get OptimizationStages() {
return require("./OptimizationStages");
},
get Parser() {

@@ -276,0 +280,0 @@ return require("./Parser");

@@ -193,2 +193,4 @@ /*

let chunkInitFragments;
const templateContext = {

@@ -201,6 +203,19 @@ runtimeTemplate: generateContext.runtimeTemplate,

runtime: generateContext.runtime,
runtimes: generateContext.runtimes,
runtimeRequirements: generateContext.runtimeRequirements,
concatenationScope: generateContext.concatenationScope,
codeGenerationResults: generateContext.codeGenerationResults,
initFragments
initFragments,
get chunkInitFragments() {
if (!chunkInitFragments) {
const data = generateContext.getData();
chunkInitFragments = data.get("chunkInitFragments");
if (!chunkInitFragments) {
chunkInitFragments = [];
data.set("chunkInitFragments", chunkInitFragments);
}
}
return chunkInitFragments;
}
};

@@ -207,0 +222,0 @@

@@ -682,4 +682,4 @@ /*

: renderContext.runtimeTemplate.isModule()
? source
: new ConcatSource(source, ";");
? source
: new ConcatSource(source, ";");
}

@@ -755,3 +755,3 @@

m => !(/** @type {Set<Module>} */ (inlinedModules).has(m))
)
)
: allModules,

@@ -842,10 +842,10 @@ module => this.renderModule(module, chunkRenderContext, hooks, true),

: inlinedModules.size > 1
? // TODO check globals and top-level declarations of other entries and chunk modules
// to make a better decision
"it need to be isolated against other entry modules."
: chunkModules
? "it need to be isolated against other modules in the chunk."
: exports && !webpackExports
? `it uses a non-standard name for the exports (${m.exportsArgument}).`
: hooks.embedInRuntimeBailout.call(m, renderContext);
? // TODO check globals and top-level declarations of other entries and chunk modules
// to make a better decision
"it need to be isolated against other entry modules."
: chunkModules
? "it need to be isolated against other modules in the chunk."
: exports && !webpackExports
? `it uses a non-standard name for the exports (${m.exportsArgument}).`
: hooks.embedInRuntimeBailout.call(m, renderContext);
let footer;

@@ -1316,10 +1316,10 @@ if (iife !== undefined) {

"execOptions.factory.call(module.exports, module, module.exports, execOptions.require);"
])
])
: runtimeRequirements.has(RuntimeGlobals.thisAsExports)
? Template.asString([
`__webpack_modules__[moduleId].call(module.exports, module, module.exports, ${RuntimeGlobals.require});`
])
: Template.asString([
`__webpack_modules__[moduleId](module, module.exports, ${RuntimeGlobals.require});`
]);
? Template.asString([
`__webpack_modules__[moduleId].call(module.exports, module, module.exports, ${RuntimeGlobals.require});`
])
: Template.asString([
`__webpack_modules__[moduleId](module, module.exports, ${RuntimeGlobals.require});`
]);
const needModuleId = runtimeRequirements.has(RuntimeGlobals.moduleId);

@@ -1337,3 +1337,3 @@ const needModuleLoaded = runtimeRequirements.has(

"return cachedModule.exports;"
])
])
: Template.indent("return cachedModule.exports;"),

@@ -1361,16 +1361,16 @@ "}",

"}"
])
])
: outputOptions.strictModuleErrorHandling
? Template.asString([
"// Execute the module function",
"try {",
Template.indent(moduleExecution),
"} catch(e) {",
Template.indent(["module.error = e;", "throw e;"]),
"}"
])
: Template.asString([
"// Execute the module function",
moduleExecution
]),
? Template.asString([
"// Execute the module function",
"try {",
Template.indent(moduleExecution),
"} catch(e) {",
Template.indent(["module.error = e;", "throw e;"]),
"}"
])
: Template.asString([
"// Execute the module function",
moduleExecution
]),
needModuleLoaded

@@ -1382,3 +1382,3 @@ ? Template.asString([

""
])
])
: "",

@@ -1385,0 +1385,0 @@ "// Return the exports of the module",

@@ -186,3 +186,3 @@ /*

jsonStr.length > 20 && typeof finalJson === "object"
? `JSON.parse('${jsonStr.replace(/[\\']/g, "\\$&")}')`
? `/*#__PURE__*/JSON.parse('${jsonStr.replace(/[\\']/g, "\\$&")}')`
: jsonStr;

@@ -189,0 +189,0 @@ /** @type {string} */

@@ -49,3 +49,6 @@ /*

compiler.hooks.emit.tapAsync(
"LibManifestPlugin",
{
name: "LibManifestPlugin",
stage: 110
},
(compilation, callback) => {

@@ -52,0 +55,0 @@ const moduleGraph = compilation.moduleGraph;

@@ -90,3 +90,7 @@ /*

.getChunkModules(chunk)
.filter(m => m instanceof ExternalModule);
.filter(
m =>
m instanceof ExternalModule &&
(m.externalType === "amd" || m.externalType === "amd-require")
);
const externals = /** @type {ExternalModule[]} */ (modules);

@@ -93,0 +97,0 @@ const externalsDepsArray = JSON.stringify(

@@ -298,3 +298,3 @@ /*

Array.isArray(options.export) ? options.export : [options.export]
)
)
: "";

@@ -301,0 +301,0 @@ const result = new ConcatSource(source);

@@ -190,3 +190,3 @@ /*

"],"
]);
]);

@@ -193,0 +193,0 @@ return new ConcatSource(

@@ -246,4 +246,4 @@ /*

? externalsArguments(requiredExternals) +
", " +
externalsRootArray(optionalExternals)
", " +
externalsRootArray(optionalExternals)
: externalsRootArray(optionalExternals);

@@ -287,32 +287,32 @@ amdFactory =

? " define(" +
libraryName(names.amd) +
", " +
externalsDepsArray(requiredExternals) +
", " +
amdFactory +
");\n"
libraryName(names.amd) +
", " +
externalsDepsArray(requiredExternals) +
", " +
amdFactory +
");\n"
: " define(" +
externalsDepsArray(requiredExternals) +
", " +
amdFactory +
");\n"
externalsDepsArray(requiredExternals) +
", " +
amdFactory +
");\n"
: names.amd && namedDefine === true
? " define(" +
libraryName(names.amd) +
", [], " +
amdFactory +
");\n"
: " define([], " + amdFactory + ");\n") +
? " define(" +
libraryName(names.amd) +
", [], " +
amdFactory +
");\n"
: " define([], " + amdFactory + ");\n") +
(names.root || names.commonjs
? getAuxiliaryComment("commonjs") +
" else if(typeof exports === 'object')\n" +
" exports[" +
libraryName(names.commonjs || names.root) +
"] = factory(" +
externalsRequireArray("commonjs") +
");\n" +
getAuxiliaryComment("root") +
" else\n" +
" " +
replaceKeys(
" else if(typeof exports === 'object')\n" +
" exports[" +
libraryName(names.commonjs || names.root) +
"] = factory(" +
externalsRequireArray("commonjs") +
");\n" +
getAuxiliaryComment("root") +
" else\n" +
" " +
replaceKeys(
accessorAccess(

@@ -323,16 +323,16 @@ "root",

)
) +
" = factory(" +
externalsRootArray(externals) +
");\n"
) +
" = factory(" +
externalsRootArray(externals) +
");\n"
: " else {\n" +
(externals.length > 0
(externals.length > 0
? " var a = typeof exports === 'object' ? factory(" +
externalsRequireArray("commonjs") +
") : factory(" +
externalsRootArray(externals) +
");\n"
externalsRequireArray("commonjs") +
") : factory(" +
externalsRootArray(externals) +
");\n"
: " var a = factory();\n") +
" for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n" +
" }\n") +
" for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n" +
" }\n") +
`})(${runtimeTemplate.outputOptions.globalObject}, ${

@@ -339,0 +339,0 @@ runtimeTemplate.supportsArrowFunction()

@@ -48,7 +48,3 @@ /*

const regExp = new RegExp(
`[\\\\/]${item.replace(
// eslint-disable-next-line no-useless-escape
/[-[\]{}()*+?.\\^$|]/g,
"\\$&"
)}([\\\\/]|$|!|\\?)`
`[\\\\/]${item.replace(/[-[\]{}()*+?.\\^$|]/g, "\\$&")}([\\\\/]|$|!|\\?)`
);

@@ -118,5 +114,3 @@ return ident => regExp.test(ident);

if (!debug) return;
// eslint-disable-next-line node/no-unsupported-features/node-builtins
if (typeof console.debug === "function") {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.debug(...labeledArgs());

@@ -150,5 +144,3 @@ } else {

if (!debug && loglevel > LogLevel.verbose) {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
if (typeof console.groupCollapsed === "function") {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.groupCollapsed(...labeledArgs());

@@ -163,5 +155,3 @@ } else {

if (!debug && loglevel > LogLevel.log) return;
// eslint-disable-next-line node/no-unsupported-features/node-builtins
if (typeof console.group === "function") {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.group(...labeledArgs());

@@ -174,5 +164,3 @@ } else {

if (!debug && loglevel > LogLevel.log) return;
// eslint-disable-next-line node/no-unsupported-features/node-builtins
if (typeof console.groupEnd === "function") {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.groupEnd();

@@ -193,5 +181,3 @@ }

case LogType.profile:
// eslint-disable-next-line node/no-unsupported-features/node-builtins
if (typeof console.profile === "function") {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.profile(...labeledArgs());

@@ -201,5 +187,3 @@ }

case LogType.profileEnd:
// eslint-disable-next-line node/no-unsupported-features/node-builtins
if (typeof console.profileEnd === "function") {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.profileEnd(...labeledArgs());

@@ -210,5 +194,3 @@ }

if (!debug && loglevel > LogLevel.log) return;
// eslint-disable-next-line node/no-unsupported-features/node-builtins
if (typeof console.clear === "function") {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.clear();

@@ -215,0 +197,0 @@ }

@@ -62,3 +62,4 @@ /*

* @property {ChunkGraph} chunkGraph the chunk graph
* @property {RuntimeSpec} runtime the runtimes code should be generated for
* @property {RuntimeSpec} runtime the runtime code should be generated for
* @property {RuntimeSpec[]} [runtimes] the runtimes code should be generated for
* @property {ConcatenationScope=} concatenationScope when in concatenated module, information about other concatenated modules

@@ -65,0 +66,0 @@ * @property {CodeGenerationResults} codeGenerationResults code generation results of other modules (need to have a codeGenerationDependency to use that)

@@ -165,3 +165,3 @@ /*

moduleFilenameTemplate: options
})
})
};

@@ -168,0 +168,0 @@

@@ -99,3 +99,3 @@ /*

: ""
}`
}`
: ""

@@ -102,0 +102,0 @@ }`

@@ -62,4 +62,4 @@ /*

: childOptions && typeof childOptions === "object"
? childOptions
: undefined)
? childOptions
: undefined)
},

@@ -66,0 +66,0 @@ context

@@ -105,13 +105,9 @@ /*

},
// eslint-disable-next-line node/no-unsupported-features/node-builtins
profile: console.profile && (name => console.profile(name)),
// eslint-disable-next-line node/no-unsupported-features/node-builtins
profileEnd: console.profileEnd && (name => console.profileEnd(name)),
clear:
!appendOnly &&
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.clear &&
(() => {
clearStatusMessage();
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.clear();

@@ -140,4 +136,4 @@ writeStatusMessage();

}
}
}
};
};

@@ -116,6 +116,6 @@ /*

RuntimeGlobals.onChunksLoaded
}.readFileVm = ${runtimeTemplate.returningFunction(
}.readFileVm = ${runtimeTemplate.returningFunction(
"installedChunks[chunkId] === 0",
"chunkId"
)};`
)};`
: "// no on chunks loaded",

@@ -145,3 +145,3 @@ "",

withOnChunkLoad ? `${RuntimeGlobals.onChunksLoaded}();` : ""
])};`
])};`
: "// no chunk install function needed",

@@ -197,6 +197,6 @@ "",

"}"
])
])
: Template.indent(["installedChunks[chunkId] = 0;"]),
"};"
])
])
: "// no chunk loading",

@@ -208,3 +208,3 @@ "",

`${RuntimeGlobals.externalInstallChunk} = installChunk;`
])
])
: "// no external install chunk",

@@ -270,3 +270,3 @@ "",

)
])
])
: "// no HMR",

@@ -299,3 +299,3 @@ "",

"}"
])
])
: "// no HMR manifest"

@@ -302,0 +302,0 @@ ]);

@@ -116,6 +116,6 @@ /*

RuntimeGlobals.onChunksLoaded
}.require = ${runtimeTemplate.returningFunction(
}.require = ${runtimeTemplate.returningFunction(
"installedChunks[chunkId]",
"chunkId"
)};`
)};`
: "// no on chunks loaded",

@@ -139,3 +139,3 @@ "",

withOnChunkLoad ? `${RuntimeGlobals.onChunksLoaded}();` : ""
])};`
])};`
: "// no chunk install function needed",

@@ -167,6 +167,6 @@ "",

"}"
]
]
: "installedChunks[chunkId] = 1;"
)};`
])
])
: "// no chunk loading",

@@ -178,3 +178,3 @@ "",

`${RuntimeGlobals.externalInstallChunk} = installChunk;`
])
])
: "// no external install chunk",

@@ -227,3 +227,3 @@ "",

)
])
])
: "// no HMR",

@@ -244,3 +244,3 @@ "",

"}"
])
])
: "// no HMR manifest"

@@ -247,0 +247,0 @@ ]);

@@ -16,2 +16,3 @@ /*

const ConstDependency = require("./dependencies/ConstDependency");
const ExternalModuleDependency = require("./dependencies/ExternalModuleDependency");
const {

@@ -56,2 +57,7 @@ evaluateToString,

(compilation, { normalModuleFactory }) => {
compilation.dependencyTemplates.set(
ExternalModuleDependency,
new ExternalModuleDependency.Template()
);
/**

@@ -135,2 +141,31 @@ * @param {JavascriptParser} parser the parser

* @param {string} expressionName expression name
* @param {(value: string) => void} fn function
* @returns {void}
*/
const setUrlModuleConstant = (expressionName, fn) => {
parser.hooks.expression
.for(expressionName)
.tap(PLUGIN_NAME, expr => {
const dep = new ExternalModuleDependency(
"url",
[
{
name: "fileURLToPath",
value: "__webpack_fileURLToPath__"
}
],
undefined,
fn("__webpack_fileURLToPath__"),
expr.range,
expressionName
);
dep.loc = expr.loc;
parser.state.module.addPresentationalDependency(dep);
return true;
});
};
/**
* @param {string} expressionName expression name
* @param {string} value value

@@ -156,2 +191,8 @@ * @param {string=} warning warning

break;
case "node-module":
setUrlModuleConstant(
"__filename",
functionName => `${functionName}(import.meta.url)`
);
break;
case true:

@@ -184,2 +225,9 @@ setModuleConstant("__filename", module =>

break;
case "node-module":
setUrlModuleConstant(
"__dirname",
functionName =>
`${functionName}(import.meta.url + "/..").slice(0, -1)`
);
break;
case true:

@@ -186,0 +234,0 @@ setModuleConstant("__dirname", module =>

@@ -135,10 +135,10 @@ /*

: sourceRoot.endsWith("/")
? source =>
source.startsWith("/")
? `${sourceRoot.slice(0, -1)}${source}`
: `${sourceRoot}${source}`
: source =>
source.startsWith("/")
? `${sourceRoot}${source}`
: `${sourceRoot}/${source}`;
? source =>
source.startsWith("/")
? `${sourceRoot.slice(0, -1)}${source}`
: `${sourceRoot}${source}`
: source =>
source.startsWith("/")
? `${sourceRoot}${source}`
: `${sourceRoot}/${source}`;
const newSources = sourceMap.sources.map(source =>

@@ -786,3 +786,3 @@ contextifySourceUrl(context, mapper(source), associatedObjectForCache)

currentLoader.loader
)
)
: "unknown"

@@ -1186,2 +1186,3 @@ }) didn't return a Buffer or String`

runtime,
runtimes,
concatenationScope,

@@ -1210,3 +1211,3 @@ codeGenerationResults,

"throw new Error(" + JSON.stringify(this.error.message) + ");"
)
)
: this.generator.generate(this, {

@@ -1219,2 +1220,3 @@ dependencyTemplates,

runtime,
runtimes,
concatenationScope,

@@ -1224,3 +1226,3 @@ codeGenerationResults,

type
});
});

@@ -1227,0 +1229,0 @@ if (source) {

@@ -414,4 +414,4 @@ /*

: noAutoLoaders
? 1
: 0
? 1
: 0
)

@@ -680,3 +680,3 @@ .split(/!+/);

dependencyType
)
)
: resolveOptions

@@ -1068,6 +1068,6 @@ );

: /\.cjs$/i.test(parsedResult.path)
? "commonjs"
: resolveRequest.descriptionFileData === undefined
? undefined
: resolveRequest.descriptionFileData.type;
? "commonjs"
: resolveRequest.descriptionFileData === undefined
? undefined
: resolveRequest.descriptionFileData.type;

@@ -1074,0 +1074,0 @@ const resolved = {

@@ -338,6 +338,6 @@ /*

: asiSafe
? `(${info.interopDefaultAccessName}())`
: asiSafe === false
? `;(${info.interopDefaultAccessName}())`
: `${info.interopDefaultAccessName}.a`;
? `(${info.interopDefaultAccessName}())`
: asiSafe === false
? `;(${info.interopDefaultAccessName}())`
: `${info.interopDefaultAccessName}.a`;
return {

@@ -572,4 +572,4 @@ info,

: asiSafe === false
? `;(0,${reference})`
: `/*#__PURE__*/Object(${reference})`;
? `;(0,${reference})`
: `/*#__PURE__*/Object(${reference})`;
}

@@ -1546,3 +1546,3 @@ return reference;

","
)}\n});\n`
)}\n});\n`
: "";

@@ -1549,0 +1549,0 @@ if (nsObj.length > 0)

@@ -180,3 +180,2 @@ /*

}
return true;
}

@@ -340,2 +339,11 @@ }

return true;
} else if (
decl.id.type === "Identifier" &&
decl.init &&
decl.init.type === "ClassExpression" &&
classWithTopLevelSymbol.has(decl.init)
) {
parser.walkExpression(decl.init);
InnerGraph.setTopLevelSymbol(parser.state, undefined);
return true;
}

@@ -342,0 +350,0 @@ });

@@ -287,4 +287,4 @@ /*

: filteredRuntime === false
? undefined
: filteredRuntime;
? undefined
: filteredRuntime;

@@ -291,0 +291,0 @@ // create a configuration with the root

@@ -9,4 +9,2 @@ /*

const { STAGE_BASIC } = require("../OptimizationStages");
const Queue = require("../util/Queue");
const { intersect } = require("../util/SetHelpers");

@@ -16,3 +14,51 @@ /** @typedef {import("../Chunk")} Chunk */

/** @typedef {import("../Compiler")} Compiler */
/** @typedef {import("../Module")} Module */
/**
* Intersects multiple masks represented as bigints
* @param {bigint[]} masks The module masks to intersect
* @returns {bigint} The intersection of all masks
*/
function intersectMasks(masks) {
let result = masks[0];
for (let i = masks.length - 1; i >= 1; i--) {
result &= masks[i];
}
return result;
}
const ZERO_BIGINT = BigInt(0);
const ONE_BIGINT = BigInt(1);
const THIRTY_TWO_BIGINT = BigInt(32);
/**
* Parses the module mask and returns the modules represented by it
* @param {bigint} mask the module mask
* @param {Module[]} ordinalModules the modules in the order they were added to the mask (LSB is index 0)
* @returns {Generator<Module>} the modules represented by the mask
*/
function* getModulesFromMask(mask, ordinalModules) {
let offset = 31;
while (mask !== ZERO_BIGINT) {
// Consider the last 32 bits, since that's what Math.clz32 can handle
let last32 = Number(BigInt.asUintN(32, mask));
while (last32 > 0) {
let last = Math.clz32(last32);
// The number of trailing zeros is the number trimmed off the input mask + 31 - the number of leading zeros
// The 32 is baked into the initial value of offset
const moduleIndex = offset - last;
// The number of trailing zeros is the index into the array generated by getOrCreateModuleMask
const module = ordinalModules[moduleIndex];
yield module;
// Remove the matched module from the mask
// Since we can only count leading zeros, not trailing, we can't just downshift the mask
last32 &= ~(1 << (31 - last));
}
// Remove the processed chunk from the mask
mask >>= THIRTY_TWO_BIGINT;
offset += 32;
}
}
class RemoveParentModulesPlugin {

@@ -31,10 +77,53 @@ /**

const chunkGraph = compilation.chunkGraph;
const queue = new Queue();
const queue = new Set();
const availableModulesMap = new WeakMap();
let nextModuleMask = ONE_BIGINT;
const maskByModule = new WeakMap();
const ordinalModules = [];
/**
* Gets or creates a unique mask for a module
* @param {Module} mod the module to get the mask for
* @returns {bigint} the module mask to uniquely identify the module
*/
const getOrCreateModuleMask = mod => {
let id = maskByModule.get(mod);
if (id === undefined) {
id = nextModuleMask;
ordinalModules.push(mod);
maskByModule.set(mod, id);
nextModuleMask <<= ONE_BIGINT;
}
return id;
};
// Initialize masks by chunk and by chunk group for quicker comparisons
const chunkMasks = new WeakMap();
for (const chunk of chunks) {
let mask = ZERO_BIGINT;
for (const m of chunkGraph.getChunkModulesIterable(chunk)) {
const id = getOrCreateModuleMask(m);
mask |= id;
}
chunkMasks.set(chunk, mask);
}
const chunkGroupMasks = new WeakMap();
for (const chunkGroup of chunkGroups) {
let mask = ZERO_BIGINT;
for (const chunk of chunkGroup.chunks) {
const chunkMask = chunkMasks.get(chunk);
if (chunkMask !== undefined) {
mask |= chunkMask;
}
}
chunkGroupMasks.set(chunkGroup, mask);
}
for (const chunkGroup of compilation.entrypoints.values()) {
// initialize available modules for chunks without parents
availableModulesMap.set(chunkGroup, new Set());
availableModulesMap.set(chunkGroup, ZERO_BIGINT);
for (const child of chunkGroup.childrenIterable) {
queue.enqueue(child);
queue.add(child);
}

@@ -44,11 +133,10 @@ }

// initialize available modules for chunks without parents
availableModulesMap.set(chunkGroup, new Set());
availableModulesMap.set(chunkGroup, ZERO_BIGINT);
for (const child of chunkGroup.childrenIterable) {
queue.enqueue(child);
queue.add(child);
}
}
while (queue.length > 0) {
const chunkGroup = queue.dequeue();
let availableModules = availableModulesMap.get(chunkGroup);
for (const chunkGroup of queue) {
let availableModulesMask = availableModulesMap.get(chunkGroup);
let changed = false;

@@ -58,22 +146,14 @@ for (const parent of chunkGroup.parentsIterable) {

if (availableModulesInParent !== undefined) {
const parentMask =
availableModulesInParent | chunkGroupMasks.get(parent);
// If we know the available modules in parent: process these
if (availableModules === undefined) {
if (availableModulesMask === undefined) {
// if we have not own info yet: create new entry
availableModules = new Set(availableModulesInParent);
for (const chunk of parent.chunks) {
for (const m of chunkGraph.getChunkModulesIterable(chunk)) {
availableModules.add(m);
}
}
availableModulesMap.set(chunkGroup, availableModules);
availableModulesMask = parentMask;
changed = true;
} else {
for (const m of availableModules) {
if (
!chunkGraph.isModuleInChunkGroup(m, parent) &&
!availableModulesInParent.has(m)
) {
availableModules.delete(m);
changed = true;
}
let newMask = availableModulesMask & parentMask;
if (newMask !== availableModulesMask) {
changed = true;
availableModulesMask = newMask;
}

@@ -83,6 +163,10 @@ }

}
if (changed) {
availableModulesMap.set(chunkGroup, availableModulesMask);
// if something changed: enqueue our children
for (const child of chunkGroup.childrenIterable) {
queue.enqueue(child);
// Push the child to the end of the queue
queue.delete(child);
queue.add(child);
}

@@ -94,2 +178,5 @@ }

for (const chunk of chunks) {
const chunkMask = chunkMasks.get(chunk);
if (chunkMask === undefined) continue; // No info about this chunk
const availableModulesSets = Array.from(

@@ -100,24 +187,13 @@ chunk.groupsIterable,

if (availableModulesSets.some(s => s === undefined)) continue; // No info about this chunk group
const availableModules =
availableModulesSets.length === 1
? availableModulesSets[0]
: intersect(availableModulesSets);
const numberOfModules = chunkGraph.getNumberOfChunkModules(chunk);
const toRemove = new Set();
if (numberOfModules < availableModules.size) {
for (const m of chunkGraph.getChunkModulesIterable(chunk)) {
if (availableModules.has(m)) {
toRemove.add(m);
}
const availableModulesMask = intersectMasks(availableModulesSets);
const toRemoveMask = chunkMask & availableModulesMask;
if (toRemoveMask !== ZERO_BIGINT) {
for (const module of getModulesFromMask(
toRemoveMask,
ordinalModules
)) {
chunkGraph.disconnectChunkAndModule(chunk, module);
}
} else {
for (const m of availableModules) {
if (chunkGraph.isModuleInChunk(m, chunk)) {
toRemove.add(m);
}
}
}
for (const module of toRemove) {
chunkGraph.disconnectChunkAndModule(chunk, module);
}
}

@@ -124,0 +200,0 @@ };

@@ -162,4 +162,4 @@ /*

: statement.init
? statement.init.range[1]
: statement.range[0]
? statement.init.range[1]
: statement.range[0]
)

@@ -247,3 +247,8 @@ ) {

logger.time("update dependencies");
for (const module of modules) {
const optimizedModules = new Set();
const optimizeIncomingConnections = module => {
if (optimizedModules.has(module)) return;
optimizedModules.add(module);
if (module.getSideEffectsConnectionState(moduleGraph) === false) {

@@ -263,2 +268,5 @@ const exportsInfo = moduleGraph.getExportsInfo(module);

) {
if (connection.originModule !== null) {
optimizeIncomingConnections(connection.originModule);
}
// TODO improve for export *

@@ -320,2 +328,6 @@ if (isReexport && dep.name) {

}
};
for (const module of modules) {
optimizeIncomingConnections(module);
}

@@ -322,0 +334,0 @@ logger.timeEnd("update dependencies");

@@ -752,4 +752,4 @@ /*

: cacheGroupSource.enforce
? 1
: this.options.minChunks,
? 1
: this.options.minChunks,
maxAsyncRequests:

@@ -759,4 +759,4 @@ cacheGroupSource.maxAsyncRequests !== undefined

: cacheGroupSource.enforce
? Infinity
: this.options.maxAsyncRequests,
? Infinity
: this.options.maxAsyncRequests,
maxInitialRequests:

@@ -766,4 +766,4 @@ cacheGroupSource.maxInitialRequests !== undefined

: cacheGroupSource.enforce
? Infinity
: this.options.maxInitialRequests,
? Infinity
: this.options.maxInitialRequests,
getName:

@@ -1434,9 +1434,9 @@ cacheGroupSource.getName !== undefined

: chunk.canBeInitial()
? Math.min(
/** @type {number} */
(item.cacheGroup.maxInitialRequests),
/** @type {number} */
(item.cacheGroup.maxAsyncRequests)
)
: item.cacheGroup.maxAsyncRequests
? Math.min(
/** @type {number} */
(item.cacheGroup.maxInitialRequests),
/** @type {number} */
(item.cacheGroup.maxAsyncRequests)
)
: item.cacheGroup.maxAsyncRequests
);

@@ -1576,3 +1576,3 @@ if (

Math.max
)
)
: item.cacheGroup.minSize,

@@ -1584,3 +1584,3 @@ maxAsyncSize: oldMaxSizeSettings

Math.min
)
)
: item.cacheGroup.maxAsyncSize,

@@ -1592,3 +1592,3 @@ maxInitialSize: oldMaxSizeSettings

Math.min
)
)
: item.cacheGroup.maxInitialSize,

@@ -1595,0 +1595,0 @@ automaticNameDelimiter: item.cacheGroup.automaticNameDelimiter,

@@ -45,6 +45,6 @@ /*

`${RuntimeGlobals.prefetchChunk}(${JSON.stringify(c.id)});`
)
)
: `${JSON.stringify(Array.from(chunks, c => c.id))}.map(${
RuntimeGlobals.prefetchChunk
});`
});`
)}, 5);`

@@ -51,0 +51,0 @@ )

@@ -275,3 +275,3 @@ /*

`${path}.or`,
condition.and,
condition.or,
"Expected array of conditions"

@@ -278,0 +278,0 @@ );

@@ -66,3 +66,3 @@ /*

"}"
]),
]),
"// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration",

@@ -76,3 +76,3 @@ '// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.',

undoPath
)};`
)};`
]);

@@ -79,0 +79,0 @@ }

@@ -155,3 +155,3 @@ /*

})
)
)
: JSON.stringify(chunkFilename);

@@ -223,3 +223,3 @@ const staticChunkFilename = compilation.getPath(chunkFilenameValue, {

obj[/** @type {number | string} */ (lastKey)]
)} : chunkId)`
)} : chunkId)`
: JSON.stringify(obj[/** @type {number | string} */ (lastKey)]);

@@ -290,3 +290,3 @@ }

id => `${JSON.stringify(id)}:1`
).join(",")}}[chunkId]`;
).join(",")}}[chunkId]`;
return `if (${condition}) return ${url};`;

@@ -297,3 +297,3 @@ })

`return ${url};`
]
]
: ["// return url for filenames based on template", `return ${url};`]

@@ -300,0 +300,0 @@ )};`

@@ -49,3 +49,3 @@ /*

)}`
]
]
: []),

@@ -58,3 +58,3 @@ ...(this.runtimeRequirements.has(RuntimeGlobals.createScriptUrl)

)}`
]
]
: [])

@@ -85,7 +85,7 @@ ].join(",\n")

"}"
]
]
: [])
]),
"}"
]
]
: [])

@@ -92,0 +92,0 @@ ]),

@@ -93,3 +93,3 @@ /*

"}"
])
])
: "",

@@ -110,3 +110,3 @@ `script.src = ${

"}"
])
])
: ""

@@ -113,0 +113,0 @@ ]);

@@ -49,24 +49,25 @@ /*

: chunkIds.length === 1
? `return ${RuntimeGlobals.ensureChunk}(${JSON.stringify(
chunkIds[0]
)}).then(next);`
: chunkIds.length > 2
? [
// using map is shorter for 3 or more chunks
`return Promise.all(${JSON.stringify(chunkIds)}.map(${
RuntimeGlobals.ensureChunk
}, ${RuntimeGlobals.require})).then(next);`
]
: [
// calling ensureChunk directly is shorter for 0 - 2 chunks
"return Promise.all([",
Template.indent(
chunkIds
.map(
id => `${RuntimeGlobals.ensureChunk}(${JSON.stringify(id)})`
)
.join(",\n")
),
"]).then(next);"
]
? `return ${RuntimeGlobals.ensureChunk}(${JSON.stringify(
chunkIds[0]
)}).then(next);`
: chunkIds.length > 2
? [
// using map is shorter for 3 or more chunks
`return Promise.all(${JSON.stringify(chunkIds)}.map(${
RuntimeGlobals.ensureChunk
}, ${RuntimeGlobals.require})).then(next);`
]
: [
// calling ensureChunk directly is shorter for 0 - 2 chunks
"return Promise.all([",
Template.indent(
chunkIds
.map(
id =>
`${RuntimeGlobals.ensureChunk}(${JSON.stringify(id)})`
)
.join(",\n")
),
"]).then(next);"
]
)};`

@@ -73,0 +74,0 @@ ]);

@@ -44,3 +44,3 @@ /*

])})`
]
]
: [

@@ -50,3 +50,3 @@ `chunkIds.map(${RuntimeGlobals.ensureChunk}, ${RuntimeGlobals.require})`,

"return r === undefined ? result : r;"
])
])
])}`;

@@ -53,0 +53,0 @@ }

@@ -105,2 +105,6 @@ /*

supportsAsyncFunction() {
return this.outputOptions.environment.asyncFunction;
}
supportsOptionalChaining() {

@@ -226,3 +230,3 @@ return this.outputOptions.environment.optionalChaining;

items.map((item, i) => `var ${item} = ${value}[${i}];`)
);
);
}

@@ -235,3 +239,3 @@

items.map(item => `var ${item} = ${value}${propertyAccess([item])};`)
);
);
}

@@ -248,3 +252,3 @@

body
)}\n});`;
)}\n});`;
}

@@ -350,6 +354,6 @@

: idExpr
? `"Module '" + ${idExpr} + "' is not available (weak dependency)"`
: JSON.stringify(
`Module '${moduleId}' is not available (weak dependency)`
);
? `"Module '" + ${idExpr} + "' is not available (weak dependency)"`
: JSON.stringify(
`Module '${moduleId}' is not available (weak dependency)`
);
const comment = request ? Template.toNormalComment(request) + " " : "";

@@ -848,4 +852,4 @@ const errorStatements =

: asiSafe === false
? `;(${importVar}_default()${propertyAccess(exportName, 1)})`
: `${importVar}_default.a${propertyAccess(exportName, 1)}`;
? `;(${importVar}_default()${propertyAccess(exportName, 1)})`
: `${importVar}_default.a${propertyAccess(exportName, 1)}`;
}

@@ -907,4 +911,4 @@ case "default-only":

: asiSafe === false
? `;(0,${access})`
: `/*#__PURE__*/Object(${access})`;
? `;(0,${access})`
: `/*#__PURE__*/Object(${access})`;
}

@@ -911,0 +915,0 @@ return access;

@@ -203,3 +203,3 @@ /*

...entry
}
}
);

@@ -206,0 +206,0 @@ }

@@ -63,3 +63,3 @@ /*

buf.writeBigUInt64LE(BigInt(value), offset);
}
}
: (buf, value, offset) => {

@@ -70,3 +70,3 @@ const low = value % 0x100000000;

buf.writeUInt32LE(high, offset + 4);
};
};

@@ -76,3 +76,3 @@ const readUInt64LE = Buffer.prototype.readBigUInt64LE

return Number(buf.readBigUInt64LE(offset));
}
}
: (buf, offset) => {

@@ -82,3 +82,3 @@ const low = buf.readUInt32LE(offset);

return high * 0x100000000 + low;
};
};

@@ -85,0 +85,0 @@ /**

@@ -721,6 +721,6 @@ /*

: !serializerEntry[1].request
? serializerEntry[0].name
: serializerEntry[1].name
? `${serializerEntry[1].request} ${serializerEntry[1].name}`
: serializerEntry[1].request;
? serializerEntry[0].name
: serializerEntry[1].name
? `${serializerEntry[1].request} ${serializerEntry[1].name}`
: serializerEntry[1].request;
err.message += `\n(during deserialization of ${name})`;

@@ -727,0 +727,0 @@ throw err;

@@ -63,3 +63,3 @@ /*

? // item is a request/key
{
{
import: key,

@@ -73,6 +73,6 @@ shareScope: options.shareScope || "default",

eager: false
}
}
: // key is a request/key
// item is a version
{
// item is a version
{
import: key,

@@ -86,3 +86,3 @@ shareScope: options.shareScope || "default",

eager: false
};
};
return result;

@@ -89,0 +89,0 @@ },

@@ -182,3 +182,3 @@ /*

'if (typeof console !== "undefined" && console.warn) console.warn(msg);'
])
])
};`,

@@ -316,3 +316,3 @@ `var warnInvalidVersion = ${runtimeTemplate.basicFunction(

])});`
])
])
: "// no consumes in initial chunks",

@@ -326,2 +326,3 @@ this._runtimeRequirements.has(RuntimeGlobals.ensureChunkHandlers)

)};`,
"var startedInstallModules = {};",
`${

@@ -336,2 +337,3 @@ RuntimeGlobals.ensureChunkHandlers

`if(${RuntimeGlobals.hasOwnProperty}(installedModules, id)) return promises.push(installedModules[id]);`,
"if(!startedInstallModules[id]) {",
`var onFactory = ${runtimeTemplate.basicFunction(

@@ -349,2 +351,3 @@ "factory",

)};`,
"startedInstallModules[id] = true;",
`var onError = ${runtimeTemplate.basicFunction("error", [

@@ -368,3 +371,4 @@ "delete installedModules[id];",

]),
"} catch(e) { onError(e); }"
"} catch(e) { onError(e); }",
"}"
]

@@ -375,3 +379,3 @@ )});`

])}`
])
])
: "// no chunk loading of consumes"

@@ -378,0 +382,0 @@ ]);

@@ -144,3 +144,3 @@ /*

runtimeRequirements
})
})
: runtimeTemplate.asyncModuleFactory({

@@ -151,3 +151,3 @@ block: this.blocks[0],

runtimeRequirements
})
})
}${this._eager ? ", 1" : ""});`;

@@ -154,0 +154,0 @@ const sources = new Map();

@@ -37,7 +37,7 @@ /*

import: item
}
}
: {
import: key,
requiredVersion: item
};
};
return config;

@@ -44,0 +44,0 @@ },

@@ -92,3 +92,3 @@ /*

'if (typeof console !== "undefined" && console.warn) console.warn(msg);'
])
])
};`,

@@ -95,0 +95,0 @@ `var uniqueName = ${JSON.stringify(uniqueName || undefined)};`,

@@ -374,31 +374,27 @@ /*

exports.getRequiredVersionFromDescriptionFile = (data, packageName) => {
if (
data.optionalDependencies &&
typeof data.optionalDependencies === "object" &&
packageName in data.optionalDependencies
) {
return normalizeVersion(data.optionalDependencies[packageName]);
/**
*
* @param {object} data description file data i.e.: package.json
* @param {string} packageName name of the dependency
* @returns {string} normalized version
*/
const getRequiredVersionFromDescriptionFile = (data, packageName) => {
const dependencyTypes = [
"optionalDependencies",
"dependencies",
"peerDependencies",
"devDependencies"
];
for (const dependencyType of dependencyTypes) {
if (
data[dependencyType] &&
typeof data[dependencyType] === "object" &&
packageName in data[dependencyType]
) {
return normalizeVersion(data[dependencyType][packageName]);
}
}
if (
data.dependencies &&
typeof data.dependencies === "object" &&
packageName in data.dependencies
) {
return normalizeVersion(data.dependencies[packageName]);
}
if (
data.peerDependencies &&
typeof data.peerDependencies === "object" &&
packageName in data.peerDependencies
) {
return normalizeVersion(data.peerDependencies[packageName]);
}
if (
data.devDependencies &&
typeof data.devDependencies === "object" &&
packageName in data.devDependencies
) {
return normalizeVersion(data.devDependencies[packageName]);
}
};
exports.getRequiredVersionFromDescriptionFile =
getRequiredVersionFromDescriptionFile;

@@ -489,3 +489,3 @@ /*

`/${filename}`
)
)
: filename,

@@ -505,3 +505,3 @@ contentHash: sourceMapContentHash

`/${sourceMapFile}`
);
);
/** @type {Source} */

@@ -508,0 +508,0 @@ let asset = new RawSource(source);

@@ -200,4 +200,4 @@ /*

: forToString
? all === true
: all !== false,
? all === true
: all !== false,
cachedModules: ({ all, cached }, { forToString }) =>

@@ -242,7 +242,3 @@ cached !== undefined ? cached : forToString ? all === true : all !== false,

const regExp = new RegExp(
`[\\\\/]${item.replace(
// eslint-disable-next-line no-useless-escape
/[-[\]{}()*+?.\\^$|]/g,
"\\$&"
)}([\\\\/]|$|!|\\?)`
`[\\\\/]${item.replace(/[-[\]{}()*+?.\\^$|]/g, "\\$&")}([\\\\/]|$|!|\\?)`
);

@@ -249,0 +245,0 @@ return ident => regExp.test(ident);

@@ -131,3 +131,3 @@ /*

`${warningsCount} ${plural(warningsCount, "warning", "warnings")}`
)
)
: "";

@@ -147,6 +147,6 @@ const errorsMessage =

: name
? `Child ${bold(name)}`
: root
? ""
: "Child";
? `Child ${bold(name)}`
: root
? ""
: "Child";
const subjectMessage =

@@ -185,3 +185,3 @@ nameMessage && versionMessage

"warnings have"
)} detailed information that is not shown.\nUse 'stats.errorDetails: true' resp. '--stats-error-details' to show it.`
)} detailed information that is not shown.\nUse 'stats.errorDetails: true' resp. '--stats-error-details' to show it.`
: undefined,

@@ -196,3 +196,3 @@ "compilation.filteredErrorDetailsCount": (count, { yellow }) =>

)} detailed information that is not shown.\nUse 'stats.errorDetails: true' resp. '--stats-error-details' to show it.`
)
)
: undefined,

@@ -211,3 +211,3 @@ "compilation.env": (env, { bold }) =>

chunkGroupKind: "Entrypoint"
}),
}),
"compilation.namedChunkGroups": (namedChunkGroups, context, printer) => {

@@ -242,5 +242,8 @@ if (!Array.isArray(namedChunkGroups)) {

"modules"
)}`
)}`
: undefined,
"compilation.filteredAssets": (filteredAssets, { compilation: { assets } }) =>
"compilation.filteredAssets": (
filteredAssets,
{ compilation: { assets } }
) =>
filteredAssets > 0

@@ -251,3 +254,3 @@ ? `${moreCount(assets, filteredAssets)} ${plural(

"assets"
)}`
)}`
: undefined,

@@ -261,3 +264,3 @@ "compilation.logging": (logging, context, printer) =>

context
),
),
"compilation.warningsInChildren!": (_, { yellow, compilation }) => {

@@ -335,3 +338,3 @@ if (

: `from: ${sourceFilename}`
)
)
: undefined,

@@ -351,3 +354,3 @@ "asset.info.development": (development, { green, formatFlag }) =>

"assets"
)}`
)}`
: undefined,

@@ -360,3 +363,3 @@ "asset.filteredChildren": (filteredChildren, { asset: { children } }) =>

"assets"
)}`
)}`
: undefined,

@@ -407,3 +410,3 @@

)
)
)
: undefined,

@@ -414,6 +417,6 @@ "module.warnings": (warnings, { formatFlag, yellow }) =>

: warnings
? yellow(
formatFlag(`${warnings} ${plural(warnings, "warning", "warnings")}`)
)
: undefined,
? yellow(
formatFlag(`${warnings} ${plural(warnings, "warning", "warnings")}`)
)
: undefined,
"module.errors": (errors, { formatFlag, red }) =>

@@ -423,4 +426,4 @@ errors === true

: errors
? red(formatFlag(`${errors} ${plural(errors, "error", "errors")}`))
: undefined,
? red(formatFlag(`${errors} ${plural(errors, "error", "errors")}`))
: undefined,
"module.providedExports": (providedExports, { formatFlag, cyan }) => {

@@ -466,3 +469,3 @@ if (Array.isArray(providedExports)) {

"modules"
)}`
)}`
: undefined,

@@ -475,3 +478,3 @@ "module.filteredReasons": (filteredReasons, { module: { reasons } }) =>

"reasons"
)}`
)}`
: undefined,

@@ -484,3 +487,3 @@ "module.filteredChildren": (filteredChildren, { module: { children } }) =>

"modules"
)}`
)}`
: undefined,

@@ -512,3 +515,3 @@ "module.separator!": () => "\n",

"reasons"
)}`
)}`
: undefined,

@@ -554,3 +557,3 @@

"assets"
)}`
)}`
: undefined,

@@ -574,3 +577,3 @@ "chunkGroup.is!": () => "=",

context
),
),
"chunkGroupChildGroup.type": type => `${type}:`,

@@ -604,3 +607,3 @@ "chunkGroupChild.assets[]": (file, { formatFilename }) =>

context
),
),
"chunk.childrenByOrder[].type": type => `${type}:`,

@@ -624,3 +627,3 @@ "chunk.childrenByOrder[].children[]": (id, { formatChunkId }) =>

"modules"
)}`
)}`
: undefined,

@@ -1379,3 +1382,3 @@ "chunk.separator!": () => "\n",

`$1${start}`
)
)
: str

@@ -1382,0 +1385,0 @@ }\u001b[39m\u001b[22m`;

@@ -460,4 +460,4 @@ /*

: internalCaching
? cachedCleverMerge(a, b)
: cleverMerge(a, b);
? cachedCleverMerge(a, b)
: cleverMerge(a, b);
}

@@ -471,4 +471,4 @@ case VALUE_TYPE_UNDEFINED:

: Array.isArray(a)
? VALUE_TYPE_ARRAY_EXTEND
: VALUE_TYPE_OBJECT
? VALUE_TYPE_ARRAY_EXTEND
: VALUE_TYPE_OBJECT
) {

@@ -475,0 +475,0 @@ case VALUE_TYPE_UNDEFINED:

@@ -13,4 +13,4 @@ /*

Buffer.from(
// 1170 bytes
"AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrIIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAFBIGoiASAASQ0ACyACJAAgAyQBIAQkAiAFJAMLqAYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+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",
// 1168 bytes
"AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrAIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAFBIGoiASAASQ0ACyACJAAgAyQBIAQkAiAFJAMLpgYCAn8EfiMEQgBSBH4jACIDQgGJIwEiBEIHiXwjAiIFQgyJfCMDIgZCEol8IANCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gBELP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAFQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAZCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQMDQCABQQhqIgIgAE0EQCADIAEpAwBCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCG4lCh5Wvr5i23puef35CnaO16oOxjYr6AH0hAyACIQEMAQsLIAFBBGoiAiAATQRAIAMgATUCAEKHla+vmLbem55/foVCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMgAiEBCwNAIAAgAUcEQCADIAExAABCxc/ZsvHluuonfoVCC4lCh5Wvr5i23puef34hAyABQQFqIQEMAQsLQQAgAyADQiGIhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFIgNCIIgiBEL//wODQiCGIARCgID8/w+DQhCIhCIEQv+BgIDwH4NCEIYgBEKA/oOAgOA/g0IIiIQiBEKPgLyA8IHAB4NCCIYgBELwgcCHgJ6A+ACDQgSIhCIEQoaMmLDgwIGDBnxCBIhCgYKEiJCgwIABg0InfiAEQrDgwIGDhoyYMIR8NwMAQQggA0L/////D4MiA0L//wODQiCGIANCgID8/w+DQhCIhCIDQv+BgIDwH4NCEIYgA0KA/oOAgOA/g0IIiIQiA0KPgLyA8IHAB4NCCIYgA0LwgcCHgJ6A+ACDQgSIhCIDQoaMmLDgwIGDBnxCBIhCgYKEiJCgwIABg0InfiADQrDgwIGDhoyYMIR8NwMACw==",
"base64"

@@ -17,0 +17,0 @@ )

@@ -379,4 +379,4 @@ /*

: enforceRelative
? `./${append}`
: append;
? `./${append}`
: append;
};

@@ -48,2 +48,6 @@ /*

require("../dependencies/CachedConstDependency"),
"dependencies/ExternalModuleDependency": () =>
require("../dependencies/ExternalModuleDependency"),
"dependencies/ExternalModuleInitFragment": () =>
require("../dependencies/ExternalModuleInitFragment"),
"dependencies/CreateScriptUrlDependency": () =>

@@ -210,2 +214,4 @@ require("../dependencies/CreateScriptUrlDependency"),

NodeStuffInWebError: () => require("../NodeStuffInWebError"),
EnvironmentNotSupportAsyncWarning: () =>
require("../EnvironmentNotSupportAsyncWarning"),
WebpackError: () => require("../WebpackError"),

@@ -212,0 +218,0 @@

@@ -60,3 +60,3 @@ /*

*/
exports.forEachRuntime = (runtime, fn, deterministicOrder = false) => {
const forEachRuntime = (runtime, fn, deterministicOrder = false) => {
if (runtime === undefined) {

@@ -73,2 +73,3 @@ fn(undefined);

};
exports.forEachRuntime = forEachRuntime;

@@ -234,2 +235,18 @@ /**

/**
* @param {RuntimeSpec[]} runtimes first
* @param {RuntimeSpec} runtime second
* @returns {RuntimeSpec} merged
*/
exports.deepMergeRuntime = (runtimes, runtime) => {
if (!Array.isArray(runtimes)) {
return runtime;
}
let merged = runtime;
for (const r of runtimes) {
merged = mergeRuntime(runtime, r);
}
return merged;
};
/**
* @param {RuntimeCondition} a first

@@ -236,0 +253,0 @@ * @param {RuntimeCondition} b second

@@ -235,12 +235,11 @@ /*

: fixCount == -1
? "<"
: fixCount == 1
? "^"
: fixCount == 2
? "~"
: fixCount > 0
? "="
: "!=";
? "<"
: fixCount == 1
? "^"
: fixCount == 2
? "~"
: fixCount > 0
? "="
: "!=";
var needDot = 1;
// eslint-disable-next-line no-redeclare
for (var i = 1; i < range.length; i++) {

@@ -253,5 +252,5 @@ var item = range[i];

? // undefined: prerelease marker, add an "-"
"-"
"-"
: // number or string: add the item, set flag to add an "." between two of them
(needDot > 0 ? "." : "") + ((needDot = 2), item);
(needDot > 0 ? "." : "") + ((needDot = 2), item);
}

@@ -269,6 +268,6 @@ return str;

: item === 1
? "(" + pop() + " || " + pop() + ")"
: item === 2
? stack.pop() + " " + stack.pop()
: rangeToString(item)
? "(" + pop() + " || " + pop() + ")"
: item === 2
? stack.pop() + " " + stack.pop()
: rangeToString(item)
);

@@ -422,6 +421,6 @@ }

: item == 2
? p() & p()
: item
? satisfy(item, version)
: !p()
? p() & p()
: item
? satisfy(item, version)
: !p()
);

@@ -459,7 +458,3 @@ }

"// see webpack/lib/util/semver.js for original code",
`var p=${
runtimeTemplate.supportsArrowFunction() ? "p=>" : "function(p)"
}{return p.split(".").map((${
runtimeTemplate.supportsArrowFunction() ? "p=>" : "function(p)"
}{return+p==p?+p:p}))},n=/^([^-+]+)?(?:-([^+]+))?(?:\\+(.+))?$/.exec(str),r=n[1]?p(n[1]):[];return n[2]&&(r.length++,r.push.apply(r,p(n[2]))),n[3]&&(r.push([]),r.push.apply(r,p(n[3]))),r;`
`var p=${runtimeTemplate.supportsArrowFunction() ? "p=>" : "function(p)"}{return p.split(".").map((${runtimeTemplate.supportsArrowFunction() ? "p=>" : "function(p)"}{return+p==p?+p:p}))},n=/^([^-+]+)?(?:-([^+]+))?(?:\\+(.+))?$/.exec(str),r=n[1]?p(n[1]):[];return n[2]&&(r.length++,r.push.apply(r,p(n[2]))),n[3]&&(r.push([]),r.push.apply(r,p(n[3]))),r;`
])}`;

@@ -466,0 +461,0 @@ //#endregion

@@ -148,3 +148,3 @@ /*

items.size
);
);
if (

@@ -151,0 +151,0 @@ sizeValue > bestGroupSize ||

@@ -72,3 +72,3 @@ /*

"}"
])
])
: "// no support for streaming compilation",

@@ -75,0 +75,0 @@ "return req",

@@ -159,3 +159,3 @@ /*

"}"
])
])
: undefined;

@@ -198,3 +198,3 @@

)}, 1);`
])
])
: `${importsCode}${importsCompatCode}module.exports = ${instantiateCall};`

@@ -201,0 +201,0 @@ );

@@ -10,2 +10,3 @@ /*

const { decode } = require("@webassemblyjs/wasm-parser");
const EnvironmentNotSupportAsyncWarning = require("../EnvironmentNotSupportAsyncWarning");
const Parser = require("../Parser");

@@ -54,2 +55,7 @@ const StaticExportsDependency = require("../dependencies/StaticExportsDependency");

BuildMeta.async = true;
EnvironmentNotSupportAsyncWarning.check(
state.module,
state.compilation.runtimeTemplate,
"asyncWebAssembly"
);

@@ -56,0 +62,0 @@ // parse it

@@ -357,3 +357,3 @@ /*

])
])
])
: Template.asString([

@@ -376,3 +376,3 @@ "if(importObject && typeof importObject.then === 'function') {",

])
]),
]),
"} else {",

@@ -379,0 +379,0 @@ Template.indent([

@@ -203,4 +203,4 @@ /*

: "for(var name in wasmExports) " +
`if(name) ` +
`${module.exportsArgument}[name] = wasmExports[name];`,
`if(name) ` +
`${module.exportsArgument}[name] = wasmExports[name];`,
"// exec imports from WebAssembly module (for esm order)",

@@ -207,0 +207,0 @@ importsCode,

@@ -212,6 +212,6 @@ /*

"}"
])
])
: Template.indent(["installedChunks[chunkId] = 0;"])
)};`
])
])
: "// no chunk on demand loading",

@@ -222,3 +222,3 @@ "",

RuntimeGlobals.prefetchChunkHandlers
}.j = ${runtimeTemplate.basicFunction("chunkId", [
}.j = ${runtimeTemplate.basicFunction("chunkId", [
`if((!${

@@ -237,3 +237,3 @@ RuntimeGlobals.hasOwnProperty

crossOriginLoading
)};`
)};`
: "",

@@ -254,3 +254,3 @@ `if (${RuntimeGlobals.scriptNonce}) {`,

"}"
])};`
])};`
: "// no prefetching",

@@ -261,3 +261,3 @@ "",

RuntimeGlobals.preloadChunkHandlers
}.j = ${runtimeTemplate.basicFunction("chunkId", [
}.j = ${runtimeTemplate.basicFunction("chunkId", [
`if((!${

@@ -298,3 +298,3 @@ RuntimeGlobals.hasOwnProperty

"}"
])
])
: ""

@@ -307,3 +307,3 @@ ]),

"}"
])};`
])};`
: "// no preloaded",

@@ -393,3 +393,3 @@ "",

)
])
])
: "// no HMR",

@@ -411,3 +411,3 @@ "",

])};`
])
])
: "// no HMR manifest",

@@ -418,6 +418,6 @@ "",

RuntimeGlobals.onChunksLoaded
}.j = ${runtimeTemplate.returningFunction(
}.j = ${runtimeTemplate.returningFunction(
"installedChunks[chunkId] === 0",
"chunkId"
)};`
)};`
: "// no on chunks loaded",

@@ -474,3 +474,3 @@ "",

"chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"
])
])
: "// no jsonp function"

@@ -477,0 +477,0 @@ ]);

@@ -310,3 +310,3 @@ /*

const CssModulesPlugin = require("./css/CssModulesPlugin");
new CssModulesPlugin(options.experiments.css).apply(compiler);
new CssModulesPlugin().apply(compiler);
}

@@ -333,3 +333,3 @@

)
}),
}),
entries: !lazyOptions || lazyOptions.entries !== false,

@@ -593,3 +593,4 @@ imports: !lazyOptions || lazyOptions.imports !== false,

options.snapshot.managedPaths,
options.snapshot.immutablePaths
options.snapshot.immutablePaths,
options.snapshot.unmanagedPaths
).apply(compiler);

@@ -596,0 +597,0 @@

@@ -131,3 +131,3 @@ /*

])};`
])
])
: "// no chunk install function needed",

@@ -156,3 +156,3 @@ withLoading

"}"
]
]
: "installedChunks[chunkId] = 1;"

@@ -164,3 +164,3 @@ )};`,

"chunkLoadingGlobal.push = installChunk;"
])
])
: "// no chunk loading",

@@ -202,3 +202,3 @@ "",

)
.replace(/\$key\$/g, "importScrips")
.replace(/\$key\$/g, "importScripts")
.replace(/\$installedChunks\$/g, "installedChunks")

@@ -222,3 +222,3 @@ .replace(/\$loadUpdateChunk\$/g, "loadUpdateChunk")

)
])
])
: "// no HMR",

@@ -240,3 +240,3 @@ "",

])};`
])
])
: "// no HMR manifest"

@@ -243,0 +243,0 @@ ]);

{
"name": "webpack",
"version": "5.89.0",
"version": "5.90.0",
"author": "Tobias Koppers @sokra",

@@ -9,3 +9,3 @@ "description": "Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",

"@types/eslint-scope": "^3.7.3",
"@types/estree": "^1.0.0",
"@types/estree": "^1.0.5",
"@webassemblyjs/ast": "^1.11.5",

@@ -16,3 +16,3 @@ "@webassemblyjs/wasm-edit": "^1.11.5",

"acorn-import-assertions": "^1.9.0",
"browserslist": "^4.14.5",
"browserslist": "^4.21.10",
"chrome-trace-event": "^1.0.2",

@@ -31,3 +31,3 @@ "enhanced-resolve": "^5.15.0",

"tapable": "^2.1.1",
"terser-webpack-plugin": "^5.3.7",
"terser-webpack-plugin": "^5.3.10",
"watchpack": "^2.4.0",

@@ -42,8 +42,8 @@ "webpack-sources": "^3.2.3"

"devDependencies": {
"@babel/core": "^7.21.4",
"@babel/preset-react": "^7.18.6",
"@types/jest": "^29.5.0",
"@types/mime-types": "^2.1.1",
"@babel/core": "^7.23.7",
"@babel/preset-react": "^7.23.3",
"@types/jest": "^29.5.11",
"@types/mime-types": "^2.1.4",
"@types/node": "^20.1.7",
"assemblyscript": "^0.27.2",
"assemblyscript": "^0.27.22",
"babel-loader": "^8.1.0",

@@ -58,11 +58,11 @@ "benchmark": "^2.1.4",

"css-loader": "^5.0.1",
"date-fns": "^2.15.0",
"date-fns": "^3.2.0",
"es5-ext": "^0.10.53",
"es6-promise-polyfill": "^1.2.0",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-jest": "^27.2.1",
"eslint": "^8.48.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-jsdoc": "^43.0.5",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-prettier": "^5.1.3",
"file-loader": "^6.0.0",

@@ -74,7 +74,7 @@ "fork-ts-checker-webpack-plugin": "^8.0.0",

"istanbul": "^0.4.5",
"jest": "^29.5.0",
"jest-circus": "^29.5.0",
"jest-cli": "^29.5.0",
"jest-diff": "^29.5.0",
"jest-environment-node": "^29.5.0",
"jest": "^29.7.0",
"jest-circus": "^29.7.0",
"jest-cli": "^29.7.0",
"jest-diff": "^29.7.0",
"jest-environment-node": "^29.7.0",
"jest-junit": "^16.0.0",

@@ -93,3 +93,3 @@ "json-loader": "^0.5.7",

"open-cli": "^7.2.0",
"prettier": "^2.7.1",
"prettier": "^3.2.1",
"pretty-format": "^29.5.0",

@@ -106,5 +106,5 @@ "pug": "^3.0.0",

"style-loader": "^2.0.0",
"terser": "^5.17.0",
"terser": "^5.26.0",
"toml": "^3.0.0",
"tooling": "webpack/tooling#v1.23.0",
"tooling": "webpack/tooling#v1.23.1",
"ts-loader": "^9.4.2",

@@ -111,0 +111,0 @@ "typescript": "^5.0.4",

@@ -6,2 +6,2 @@ /*

*/
"use strict";function r(t,{instancePath:e="",parentData:a,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;for(const e in t)return r.errors=[{params:{additionalProperty:e}}],!1;return r.errors=null,!0}module.exports=r,module.exports.default=r;
"use strict";function r(t,{instancePath:a="",parentData:e,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{const a=0;for(const a in t)if("exportsOnly"!==a)return r.errors=[{params:{additionalProperty:a}}],!1;if(0===a&&void 0!==t.exportsOnly&&"boolean"!=typeof t.exportsOnly)return r.errors=[{params:{type:"boolean"}}],!1}return r.errors=null,!0}function t(a,{instancePath:e="",parentData:o,parentDataProperty:n,rootData:s=a}={}){let p=null,l=0;return r(a,{instancePath:e,parentData:o,parentDataProperty:n,rootData:s})||(p=null===p?r.errors:p.concat(r.errors),l=p.length),t.errors=p,0===l}module.exports=t,module.exports.default=t;

@@ -6,2 +6,2 @@ /*

*/
"use strict";function r(t,{instancePath:e="",parentData:a,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;for(const e in t)return r.errors=[{params:{additionalProperty:e}}],!1;return r.errors=null,!0}module.exports=r,module.exports.default=r;
"use strict";function r(t,{instancePath:a="",parentData:e,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{const a=0;for(const a in t)if("namedExports"!==a)return r.errors=[{params:{additionalProperty:a}}],!1;if(0===a&&void 0!==t.namedExports&&"boolean"!=typeof t.namedExports)return r.errors=[{params:{type:"boolean"}}],!1}return r.errors=null,!0}function t(a,{instancePath:e="",parentData:o,parentDataProperty:n,rootData:s=a}={}){let p=null,i=0;return r(a,{instancePath:e,parentData:o,parentDataProperty:n,rootData:s})||(p=null===p?r.errors:p.concat(r.errors),i=p.length),t.errors=p,0===i}module.exports=t,module.exports.default=t;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc