Merge branch 'master' into dynamically-resolve-public-path

This commit is contained in:
Tobias Koppers 2020-09-18 10:40:39 +02:00
commit 4dc04d1971
38 changed files with 930 additions and 507 deletions

View File

@ -266,6 +266,30 @@ export type RuleSetLoaderOptions =
| {
[k: string]: any;
};
/**
* Redirect module requests.
*/
export type ResolveAlias =
| {
/**
* New request.
*/
alias: string[] | false | string;
/**
* Request to be redirected.
*/
name: string;
/**
* Redirect only exact matching request.
*/
onlyModule?: boolean;
}[]
| {
/**
* New request.
*/
[k: string]: string[] | false | string;
};
/**
* A list of descriptions of loaders applied.
*/
@ -1168,27 +1192,7 @@ export interface ResolveOptions {
/**
* Redirect module requests.
*/
alias?:
| {
/**
* New request.
*/
alias: string[] | false | string;
/**
* Request to be redirected.
*/
name: string;
/**
* Redirect only exact matching request.
*/
onlyModule?: boolean;
}[]
| {
/**
* New request.
*/
[k: string]: string[] | false | string;
};
alias?: ResolveAlias;
/**
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
*/
@ -1236,6 +1240,10 @@ export interface ResolveOptions {
* Extensions added to the request when trying to find the file.
*/
extensions?: string[];
/**
* Redirect module requests when normal resolving fails.
*/
fallback?: ResolveAlias;
/**
* Filesystem for the resolver.
*/
@ -1244,6 +1252,10 @@ export interface ResolveOptions {
* Treats the request specified by the user as fully specified, meaning no extensions are added and the mainFiles in directories are not resolved (This doesn't affect requests from mainFields, aliasFields or aliases).
*/
fullySpecified?: boolean;
/**
* Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).
*/
importsFields?: string[];
/**
* Field names from the description file (package.json) which are used to find the default entry point.
*/

View File

@ -1256,7 +1256,7 @@ class FileSystemInfo {
path: directory
});
}
callback();
process.nextTick(callback);
break;
}
case RBDT_DIRECTORY_DEPENDENCIES: {
@ -2658,9 +2658,22 @@ class FileSystemInfo {
if (err) {
if (err.code === "ENOENT" || err.code === "ENOTDIR") {
// no package.json or path is not a directory
const problem = `Managed item ${path} isn't a directory or doesn't contain a package.json`;
this.logger.warn(problem);
return callback(new Error(problem));
this.fs.readdir(path, (err, elements) => {
if (
!err &&
elements.length === 1 &&
elements[0] === "node_modules"
) {
// This is only a grouping folder e. g. used by yarn
// we are only interested in existence of this special directory
this._managedItems.set(path, "nested");
return callback(null, "nested");
}
const problem = `Managed item ${path} isn't a directory or doesn't contain a package.json`;
this.logger.warn(problem);
return callback(new Error(problem));
});
return;
}
return callback(err);
}

View File

@ -66,14 +66,14 @@ class ModuleNotFoundError extends WebpackError {
if (request !== alias) {
message +=
"If you want to include a polyfill, you need to:\n" +
`\t- add an alias 'resolve.alias: { "${request}": "${alias}" }'\n` +
`\t- add an fallback 'resolve.fallback: { "${request}": "${alias}" }'\n` +
`\t- install '${dependency}'\n`;
} else {
message += `If you want to include a polyfill, you need to install '${dependency}'.\n`;
}
message +=
"If you don't want to include a polyfill, you can use an empty module like this:\n" +
`\tresolve.alias: { "${request}": false }`;
`\tresolve.fallback: { "${request}": false }`;
}
}

View File

@ -567,10 +567,11 @@ class NormalModuleFactory extends ModuleFactory {
)
: resolveOptions
);
normalResolver.resolve(
this.resolveResource(
contextInfo,
context,
unresolvedResource,
normalResolver,
resolveContext,
(err, resolvedResource, resolvedResourceResolveData) => {
if (err) return continueCallback(err);
@ -674,6 +675,54 @@ class NormalModuleFactory extends ModuleFactory {
});
}
resolveResource(
contextInfo,
context,
unresolvedResource,
resolver,
resolveContext,
callback
) {
resolver.resolve(
contextInfo,
context,
unresolvedResource,
resolveContext,
(err, resolvedResource, resolvedResourceResolveData) => {
if (err) {
if (resolver.options.fullySpecified) {
resolver
.withOptions({
fullySpecified: false
})
.resolve(
contextInfo,
context,
unresolvedResource,
resolveContext,
(err2, resolvedResource) => {
if (!err2 && resolvedResource) {
const resource = parseResource(
resolvedResource
).path.replace(/^.*[\\/]/, "");
err.message += `
Did you mean '${resource}'?
BREAKING CHANGE: The request '${unresolvedResource}' failed to resolve only because it was resolved as fully specified
(probably because the origin is a '*.mjs' file or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.`;
}
callback(err);
}
);
return;
}
}
callback(err, resolvedResource, resolvedResourceResolveData);
}
);
}
resolveRequestArray(
contextInfo,
context,

View File

@ -228,6 +228,11 @@ exports.shareScopeMap = "__webpack_require__.S";
*/
exports.initializeSharing = "__webpack_require__.I";
/**
* The current scope when getting a module from a remote
*/
exports.currentRemoteGetScope = "__webpack_require__.R";
/**
* the filename of the HMR manifest
*/

View File

@ -47,8 +47,8 @@ const { connectChunkGroupParentAndChild } = require("./GraphHelpers");
*/
/**
* @typedef {Object} ChunkGroupDep
* @property {AsyncDependenciesBlock} block referencing block
* @typedef {Object} BlockChunkGroupConnection
* @property {ChunkGroupInfo} originChunkGroupInfo origin chunk group
* @property {ChunkGroup} chunkGroup referenced chunk group
*/
@ -136,7 +136,7 @@ const extractBlockModulesMap = compilation => {
* @param {Compilation} compilation the compilation
* @param {Map<Entrypoint, Module[]>} inputEntrypointsAndModules chunk groups which are processed with the modules
* @param {Map<ChunkGroup, ChunkGroupInfo>} chunkGroupInfoMap mapping from chunk group to available modules
* @param {Map<ChunkGroup, ChunkGroupDep[]>} chunkGroupDependencies dependencies for chunk groups
* @param {Map<AsyncDependenciesBlock, BlockChunkGroupConnection[]>} blockConnections connection for blocks
* @param {Set<DependenciesBlock>} blocksWithNestedBlocks flag for blocks that have nested blocks
* @param {Set<ChunkGroup>} allCreatedChunkGroups filled with all chunk groups that are created here
*/
@ -145,7 +145,7 @@ const visitModules = (
compilation,
inputEntrypointsAndModules,
chunkGroupInfoMap,
chunkGroupDependencies,
blockConnections,
blocksWithNestedBlocks,
allCreatedChunkGroups
) => {
@ -387,6 +387,7 @@ const visitModules = (
c.addOptions(b.groupOptions);
c.addOrigin(module, b.loc, b.request);
}
blockConnections.set(b, []);
}
blockChunkGroups.set(b, cgi);
} else if (entryOptions) {
@ -396,12 +397,10 @@ const visitModules = (
}
if (c !== undefined) {
// 2. We store the Block + Chunk Group mapping as dependency
// for the chunk group which is set in processQueue
let deps = chunkGroupDependencies.get(chunkGroup);
if (!deps) chunkGroupDependencies.set(chunkGroup, (deps = []));
deps.push({
block: b,
// 2. We store the connection for the block
// to connect it later if needed
blockConnections.get(b).push({
originChunkGroupInfo: chunkGroupInfo,
chunkGroup: c
});
@ -1063,20 +1062,17 @@ const visitModules = (
*
* @param {Compilation} compilation the compilation
* @param {Set<DependenciesBlock>} blocksWithNestedBlocks flag for blocks that have nested blocks
* @param {Map<ChunkGroup, ChunkGroupDep[]>} chunkGroupDependencies dependencies for chunk groups
* @param {Map<AsyncDependenciesBlock, BlockChunkGroupConnection[]>} blockConnections connection for blocks
* @param {Map<ChunkGroup, ChunkGroupInfo>} chunkGroupInfoMap mapping from chunk group to available modules
*/
const connectChunkGroups = (
compilation,
blocksWithNestedBlocks,
chunkGroupDependencies,
blockConnections,
chunkGroupInfoMap
) => {
const { chunkGraph } = compilation;
/** @type {ModuleSetPlus} */
let resultingAvailableModules;
/**
* Helper function to check if all modules of a chunk are available
*
@ -1095,46 +1091,38 @@ const connectChunkGroups = (
};
// For each edge in the basic chunk graph
/**
* @param {ChunkGroupDep} dep the dependency used for filtering
* @returns {boolean} used to filter "edges" (aka Dependencies) that were pointing
* to modules that are already available. Also filters circular dependencies in the chunks graph
*/
const filterFn = dep => {
const depChunkGroup = dep.chunkGroup;
// TODO is this needed?
if (blocksWithNestedBlocks.has(dep.block)) return true;
if (areModulesAvailable(depChunkGroup, resultingAvailableModules)) {
return false; // break all modules are already available
for (const [block, connections] of blockConnections) {
// 1. Check if connection is needed
// When none of the dependencies need to be connected
// we can skip all of them
// It's not possible to filter each item so it doesn't create inconsistent
// connections and modules can only create one version
// TODO maybe decide this per runtime
if (
// TODO is this needed?
!blocksWithNestedBlocks.has(block) &&
connections.every(({ chunkGroup, originChunkGroupInfo }) =>
areModulesAvailable(
chunkGroup,
originChunkGroupInfo.resultingAvailableModules
)
)
) {
continue;
}
return true;
};
// For all deps, check if chunk groups need to be connected
for (const [chunkGroup, deps] of chunkGroupDependencies) {
if (deps.length === 0) continue;
// 1. Get info from chunk group info map
const info = chunkGroupInfoMap.get(chunkGroup);
resultingAvailableModules = info.resultingAvailableModules;
// 2. Foreach edge
for (let i = 0; i < deps.length; i++) {
const dep = deps[i];
for (let i = 0; i < connections.length; i++) {
const { chunkGroup, originChunkGroupInfo } = connections[i];
// Filter inline, rather than creating a new array from `.filter()`
// TODO check if inlining filterFn makes sense here
if (!filterFn(dep)) {
continue;
}
const depChunkGroup = dep.chunkGroup;
const depBlock = dep.block;
// 3. Connect block with chunk
chunkGraph.connectBlockAndChunkGroup(block, chunkGroup);
// 5. Connect block with chunk
chunkGraph.connectBlockAndChunkGroup(depBlock, depChunkGroup);
// 6. Connect chunk with parent
connectChunkGroupParentAndChild(chunkGroup, depChunkGroup);
// 4. Connect chunk with parent
connectChunkGroupParentAndChild(
originChunkGroupInfo.chunkGroup,
chunkGroup
);
}
}
};
@ -1170,8 +1158,8 @@ const buildChunkGraph = (compilation, inputEntrypointsAndModules) => {
// SHARED STATE
/** @type {Map<ChunkGroup, ChunkGroupDep[]>} */
const chunkGroupDependencies = new Map();
/** @type {Map<AsyncDependenciesBlock, BlockChunkGroupConnection[]>} */
const blockConnections = new Map();
/** @type {Set<ChunkGroup>} */
const allCreatedChunkGroups = new Set();
@ -1190,7 +1178,7 @@ const buildChunkGraph = (compilation, inputEntrypointsAndModules) => {
compilation,
inputEntrypointsAndModules,
chunkGroupInfoMap,
chunkGroupDependencies,
blockConnections,
blocksWithNestedBlocks,
allCreatedChunkGroups
);
@ -1202,7 +1190,7 @@ const buildChunkGraph = (compilation, inputEntrypointsAndModules) => {
connectChunkGroups(
compilation,
blocksWithNestedBlocks,
chunkGroupDependencies,
blockConnections,
chunkGroupInfoMap
);
logger.timeEnd("connectChunkGroups");

View File

@ -193,8 +193,10 @@ class ContainerEntryModule extends Module {
`var moduleMap = {`,
Template.indent(getters.join(",\n")),
"};",
`var get = ${runtimeTemplate.basicFunction("module", [
"return (",
`var get = ${runtimeTemplate.basicFunction("module, getScope", [
`${RuntimeGlobals.currentRemoteGetScope} = getScope;`,
// reusing the getScope variable to avoid creating a new var (and module is also used later)
"getScope = (",
Template.indent([
`${RuntimeGlobals.hasOwnProperty}(moduleMap, module)`,
Template.indent([
@ -205,16 +207,19 @@ class ContainerEntryModule extends Module {
)})`
])
]),
");"
");",
`${RuntimeGlobals.currentRemoteGetScope} = undefined;`,
"return getScope;"
])};`,
`var init = ${runtimeTemplate.basicFunction("shareScope", [
`var init = ${runtimeTemplate.basicFunction("shareScope, initScope", [
`if (!${RuntimeGlobals.shareScopeMap}) return;`,
`var oldScope = ${RuntimeGlobals.shareScopeMap}[${JSON.stringify(
this._shareScope
)}];`,
`var name = ${JSON.stringify(this._shareScope)}`,
`if(oldScope && oldScope !== shareScope) throw new Error("Container initialization failed as it has already been initialized with a different share scope");`,
`${RuntimeGlobals.shareScopeMap}[name] = shareScope;`,
`return ${RuntimeGlobals.initializeSharing}(name);`
`return ${RuntimeGlobals.initializeSharing}(name, initScope);`
])};`,
"",
"// This exports getters to disallow modifications",

View File

@ -44,7 +44,6 @@ class RemoteRuntimeModule extends RuntimeModule {
}
}
return Template.asString([
"var installedModules = {};",
`var chunkMapping = ${JSON.stringify(
chunkToRemotesMapping,
null,
@ -61,8 +60,12 @@ class RemoteRuntimeModule extends RuntimeModule {
`if(${RuntimeGlobals.hasOwnProperty}(chunkMapping, chunkId)) {`,
Template.indent([
`chunkMapping[chunkId].forEach(${runtimeTemplate.basicFunction("id", [
`if(installedModules[id]) return promises.push(installedModules[id]);`,
`var getScope = ${RuntimeGlobals.currentRemoteGetScope};`,
"if(!getScope) getScope = [];",
"var data = idToExternalAndNameMapping[id];",
"if(getScope.indexOf(data) >= 0) return;",
"getScope.push(data);",
`if(data.p) return promises.push(data.p);`,
`var onError = ${runtimeTemplate.basicFunction("error", [
'if(!error) error = new Error("Container missing");',
'if(typeof error.message === "string")',
@ -72,24 +75,24 @@ class RemoteRuntimeModule extends RuntimeModule {
`__webpack_modules__[id] = ${runtimeTemplate.basicFunction("", [
"throw error;"
])}`,
"installedModules[id] = 0;"
"data.p = 0;"
])};`,
`var handleFunction = ${runtimeTemplate.basicFunction(
"fn, key, data, next, first",
"fn, arg1, arg2, d, next, first",
[
"try {",
Template.indent([
"var promise = fn(key, data);",
"var promise = fn(arg1, arg2);",
"if(promise && promise.then) {",
Template.indent([
`var p = promise.then(${runtimeTemplate.returningFunction(
"next(result, data)",
"next(result, d)",
"result"
)}, onError);`,
`if(first) promises.push(installedModules[id] = p); else return p;`
`if(first) promises.push(data.p = p); else return p;`
]),
"} else {",
Template.indent(["return next(promise, data, first);"]),
Template.indent(["return next(promise, d, first);"]),
"}"
]),
"} catch(error) {",
@ -98,21 +101,21 @@ class RemoteRuntimeModule extends RuntimeModule {
]
)}`,
`var onExternal = ${runtimeTemplate.returningFunction(
`external ? handleFunction(${RuntimeGlobals.initializeSharing}, data[0], external, onInitialized, first) : onError()`,
`external ? handleFunction(${RuntimeGlobals.initializeSharing}, data[0], 0, external, onInitialized, first) : onError()`,
"external, _, first"
)};`,
`var onInitialized = ${runtimeTemplate.returningFunction(
`handleFunction(external.get, data[1], external, onFactory, first)`,
`handleFunction(external.get, data[1], getScope, 0, onFactory, first)`,
"_, external, first"
)};`,
`var onFactory = ${runtimeTemplate.basicFunction("factory", [
"installedModules[id] = 1;",
"data.p = 1;",
`__webpack_modules__[id] = ${runtimeTemplate.basicFunction(
"module",
["module.exports = factory();"]
)}`
])};`,
"handleFunction(__webpack_require__, data[2], 1, onExternal, 1);"
"handleFunction(__webpack_require__, data[2], 0, 0, onExternal, 1);"
])});`
]),
"}"

View File

@ -119,24 +119,24 @@ class RealContentHashPlugin {
cacheAnalyse.getLazyHashedEtag(source),
Array.from(hashes).join("|")
);
asset.referencedHashes = await cacheAnalyse.providePromise(
name,
etag,
() => {
const referencedHashes = new Set();
const inContent = content.match(hashRegExp);
if (inContent) {
for (const hash of inContent) {
if (hashes.has(hash)) {
asset.hasOwnHash = true;
continue;
}
referencedHashes.add(hash);
[
asset.referencedHashes,
asset.hasOwnHash
] = await cacheAnalyse.providePromise(name, etag, () => {
const referencedHashes = new Set();
let hasOwnHash = false;
const inContent = content.match(hashRegExp);
if (inContent) {
for (const hash of inContent) {
if (hashes.has(hash)) {
hasOwnHash = true;
continue;
}
referencedHashes.add(hash);
}
return referencedHashes;
}
);
return [referencedHashes, hasOwnHash];
});
})
);
const getDependencies = hash => {

View File

@ -177,7 +177,7 @@ class ConsumeSharedRuntimeModule extends RuntimeModule {
"function(scopeName, a, b, c) {",
Template.indent([
`var promise = ${RuntimeGlobals.initializeSharing}(scopeName);`,
`if (promise.then) return promise.then(fn.bind(fn, scopeName, ${RuntimeGlobals.shareScopeMap}[scopeName], a, b, c));`,
`if (promise && promise.then) return promise.then(fn.bind(fn, scopeName, ${RuntimeGlobals.shareScopeMap}[scopeName], a, b, c));`,
`return fn(scopeName, ${RuntimeGlobals.shareScopeMap}[scopeName], a, b, c);`
]),
"}"

View File

@ -61,13 +61,18 @@ class ShareRuntimeModule extends RuntimeModule {
return Template.asString([
`${RuntimeGlobals.shareScopeMap} = {};`,
"var initPromises = {};",
"var initTokens = {};",
`${RuntimeGlobals.initializeSharing} = ${runtimeTemplate.basicFunction(
"name",
"name, initScope",
[
"if(!initScope) initScope = [];",
"// handling circular init calls",
"var initToken = initTokens[name];",
"if(!initToken) initToken = initTokens[name] = {};",
"if(initScope.indexOf(initToken) >= 0) return;",
"initScope.push(initToken);",
"// only runs once",
"if(initPromises[name]) return initPromises[name];",
"// handling circular init calls",
"initPromises[name] = 1;",
"// creates a new share scope if needed",
`if(!${RuntimeGlobals.hasOwnProperty}(${RuntimeGlobals.shareScopeMap}, name)) ${RuntimeGlobals.shareScopeMap}[name] = {};`,
"// runs all init snippets from all modules reachable",
@ -95,7 +100,7 @@ class ShareRuntimeModule extends RuntimeModule {
"var module = __webpack_require__(id);",
"if(!module) return;",
`var initFn = ${runtimeTemplate.returningFunction(
`module && module.init && module.init(${RuntimeGlobals.shareScopeMap}[name])`,
`module && module.init && module.init(${RuntimeGlobals.shareScopeMap}[name], initScope)`,
"module"
)}`,
"if(module.then) return promises.push(module.then(initFn, handleError));",
@ -123,9 +128,10 @@ class ShareRuntimeModule extends RuntimeModule {
])
),
"}",
`return promises.length && (initPromises[name] = Promise.all(promises).then(${runtimeTemplate.returningFunction(
"if(!promises.length) return initPromises[name] = 1;",
`return initPromises[name] = Promise.all(promises).then(${runtimeTemplate.returningFunction(
"initPromises[name] = 1"
)}));`
)});`
]
)};`
]);

View File

@ -212,7 +212,7 @@ const DEFAULTS = {
chunkModulesSort: () => "name",
nestedModulesSort: () => false,
chunksSort: () => false,
assetsSort: () => "name",
assetsSort: () => "!size",
outputPath: OFF_FOR_TO_STRING,
colors: () => false
};

View File

@ -1,6 +1,6 @@
{
"name": "webpack",
"version": "5.0.0-beta.30",
"version": "5.0.0-beta.31",
"author": "Tobias Koppers @sokra",
"description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
"license": "MIT",
@ -13,7 +13,7 @@
"@webassemblyjs/wasm-parser": "1.9.0",
"acorn": "^7.4.0",
"chrome-trace-event": "^1.0.2",
"enhanced-resolve": "5.0.0-beta.10",
"enhanced-resolve": "^5.0.0",
"eslint-scope": "^5.1.0",
"events": "^3.2.0",
"glob-to-regexp": "^0.4.1",
@ -24,10 +24,10 @@
"neo-async": "^2.6.2",
"pkg-dir": "^4.2.0",
"schema-utils": "^2.7.0",
"tapable": "^2.0.0-beta.11",
"tapable": "^2.0.0",
"terser-webpack-plugin": "^4.1.0",
"watchpack": "2.0.0-beta.15",
"webpack-sources": "2.0.0-beta.10"
"watchpack": "^2.0.0",
"webpack-sources": "^2.0.0"
},
"peerDependenciesMeta": {
"webpack-cli": {

View File

@ -2203,67 +2203,17 @@
}
]
},
"ResolveLoader": {
"description": "Options for the resolver when resolving loaders.",
"oneOf": [
"ResolveAlias": {
"description": "Redirect module requests.",
"anyOf": [
{
"$ref": "#/definitions/ResolveOptions"
}
]
},
"ResolveOptions": {
"description": "Options object for resolving requests.",
"type": "object",
"additionalProperties": false,
"properties": {
"alias": {
"description": "Redirect module requests.",
"anyOf": [
{
"type": "array",
"items": {
"description": "Alias configuration.",
"type": "object",
"additionalProperties": false,
"properties": {
"alias": {
"description": "New request.",
"anyOf": [
{
"description": "Multiple alternative requests.",
"type": "array",
"items": {
"description": "One choice of request.",
"type": "string",
"minLength": 1
}
},
{
"description": "Ignore request (replace with empty module).",
"enum": [false]
},
{
"description": "New request.",
"type": "string",
"minLength": 1
}
]
},
"name": {
"description": "Request to be redirected.",
"type": "string"
},
"onlyModule": {
"description": "Redirect only exact matching request.",
"type": "boolean"
}
},
"required": ["alias", "name"]
}
},
{
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"description": "Alias configuration.",
"type": "object",
"additionalProperties": false,
"properties": {
"alias": {
"description": "New request.",
"anyOf": [
{
@ -2285,9 +2235,62 @@
"minLength": 1
}
]
},
"name": {
"description": "Request to be redirected.",
"type": "string"
},
"onlyModule": {
"description": "Redirect only exact matching request.",
"type": "boolean"
}
}
]
},
"required": ["alias", "name"]
}
},
{
"type": "object",
"additionalProperties": {
"description": "New request.",
"anyOf": [
{
"description": "Multiple alternative requests.",
"type": "array",
"items": {
"description": "One choice of request.",
"type": "string",
"minLength": 1
}
},
{
"description": "Ignore request (replace with empty module).",
"enum": [false]
},
{
"description": "New request.",
"type": "string",
"minLength": 1
}
]
}
}
]
},
"ResolveLoader": {
"description": "Options for the resolver when resolving loaders.",
"oneOf": [
{
"$ref": "#/definitions/ResolveOptions"
}
]
},
"ResolveOptions": {
"description": "Options object for resolving requests.",
"type": "object",
"additionalProperties": false,
"properties": {
"alias": {
"$ref": "#/definitions/ResolveAlias"
},
"aliasFields": {
"description": "Fields in the description file (usually package.json) which are used to redirect requests inside the module.",
@ -2373,6 +2376,14 @@
"minLength": 1
}
},
"fallback": {
"description": "Redirect module requests when normal resolving fails.",
"oneOf": [
{
"$ref": "#/definitions/ResolveAlias"
}
]
},
"fileSystem": {
"description": "Filesystem for the resolver.",
"tsType": "(import('../lib/util/fs').InputFileSystem)"
@ -2381,6 +2392,14 @@
"description": "Treats the request specified by the user as fully specified, meaning no extensions are added and the mainFiles in directories are not resolved (This doesn't affect requests from mainFields, aliasFields or aliases).",
"type": "boolean"
},
"importsFields": {
"description": "Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).",
"type": "array",
"items": {
"description": "Field name from the description file (usually package.json) which is used to provide internal request of a package (requests starting with # are considered as internal).",
"type": "string"
}
},
"mainFields": {
"description": "Field names from the description file (package.json) which are used to find the default entry point.",
"type": "array",

View File

@ -1208,6 +1208,9 @@ describe("Defaults", () => {
- "globalObject": "self",
+ "globalObject": "global",
@@ ... @@
- "publicPath": "auto",
+ "publicPath": "",
@@ ... @@
- "wasmLoading": "fetch",
+ "wasmLoading": "async-node",
@@ ... @@

View File

@ -213,17 +213,17 @@ describe("Stats", () => {
"cached": false,
"chunkIdHints": Array [],
"chunkNames": Array [
"chunkB",
"entryB",
],
"comparedForEmit": false,
"emitted": true,
"filteredRelated": undefined,
"info": Object {
"minimized": true,
"size": 107,
"size": 2698,
},
"name": "chunkB.js",
"size": 107,
"name": "entryB.js",
"size": 2698,
"type": "asset",
},
Object {
@ -251,17 +251,17 @@ describe("Stats", () => {
"cached": false,
"chunkIdHints": Array [],
"chunkNames": Array [
"entryB",
"chunkB",
],
"comparedForEmit": false,
"emitted": true,
"filteredRelated": undefined,
"info": Object {
"minimized": true,
"size": 2698,
"size": 107,
},
"name": "entryB.js",
"size": 2698,
"name": "chunkB.js",
"size": 107,
"type": "asset",
},
],

View File

@ -3368,6 +3368,67 @@ Object {
"multiple": false,
"simpleType": "boolean",
},
"resolve-fallback-alias": Object {
"configs": Array [
Object {
"description": "Ignore request (replace with empty module).",
"multiple": true,
"path": "resolve.fallback[].alias",
"type": "enum",
"values": Array [
false,
],
},
Object {
"description": "New request.",
"multiple": true,
"path": "resolve.fallback[].alias",
"type": "string",
},
],
"description": "Ignore request (replace with empty module). New request.",
"multiple": true,
"simpleType": "string",
},
"resolve-fallback-name": Object {
"configs": Array [
Object {
"description": "Request to be redirected.",
"multiple": true,
"path": "resolve.fallback[].name",
"type": "string",
},
],
"description": "Request to be redirected.",
"multiple": true,
"simpleType": "string",
},
"resolve-fallback-only-module": Object {
"configs": Array [
Object {
"description": "Redirect only exact matching request.",
"multiple": true,
"path": "resolve.fallback[].onlyModule",
"type": "boolean",
},
],
"description": "Redirect only exact matching request.",
"multiple": true,
"simpleType": "boolean",
},
"resolve-fallback-reset": Object {
"configs": Array [
Object {
"description": "Clear all items provided in configuration. Redirect module requests.",
"multiple": false,
"path": "resolve.fallback",
"type": "reset",
},
],
"description": "Clear all items provided in configuration. Redirect module requests.",
"multiple": false,
"simpleType": "boolean",
},
"resolve-fully-specified": Object {
"configs": Array [
Object {
@ -3381,6 +3442,32 @@ Object {
"multiple": false,
"simpleType": "boolean",
},
"resolve-imports-fields": Object {
"configs": Array [
Object {
"description": "Field name from the description file (usually package.json) which is used to provide internal request of a package (requests starting with # are considered as internal).",
"multiple": true,
"path": "resolve.importsFields[]",
"type": "string",
},
],
"description": "Field name from the description file (usually package.json) which is used to provide internal request of a package (requests starting with # are considered as internal).",
"multiple": true,
"simpleType": "string",
},
"resolve-imports-fields-reset": Object {
"configs": Array [
Object {
"description": "Clear all items provided in configuration. Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).",
"multiple": false,
"path": "resolve.importsFields",
"type": "reset",
},
],
"description": "Clear all items provided in configuration. Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).",
"multiple": false,
"simpleType": "boolean",
},
"resolve-loader-alias-alias": Object {
"configs": Array [
Object {
@ -3611,6 +3698,67 @@ Object {
"multiple": false,
"simpleType": "boolean",
},
"resolve-loader-fallback-alias": Object {
"configs": Array [
Object {
"description": "Ignore request (replace with empty module).",
"multiple": true,
"path": "resolveLoader.fallback[].alias",
"type": "enum",
"values": Array [
false,
],
},
Object {
"description": "New request.",
"multiple": true,
"path": "resolveLoader.fallback[].alias",
"type": "string",
},
],
"description": "Ignore request (replace with empty module). New request.",
"multiple": true,
"simpleType": "string",
},
"resolve-loader-fallback-name": Object {
"configs": Array [
Object {
"description": "Request to be redirected.",
"multiple": true,
"path": "resolveLoader.fallback[].name",
"type": "string",
},
],
"description": "Request to be redirected.",
"multiple": true,
"simpleType": "string",
},
"resolve-loader-fallback-only-module": Object {
"configs": Array [
Object {
"description": "Redirect only exact matching request.",
"multiple": true,
"path": "resolveLoader.fallback[].onlyModule",
"type": "boolean",
},
],
"description": "Redirect only exact matching request.",
"multiple": true,
"simpleType": "boolean",
},
"resolve-loader-fallback-reset": Object {
"configs": Array [
Object {
"description": "Clear all items provided in configuration. Redirect module requests.",
"multiple": false,
"path": "resolveLoader.fallback",
"type": "reset",
},
],
"description": "Clear all items provided in configuration. Redirect module requests.",
"multiple": false,
"simpleType": "boolean",
},
"resolve-loader-fully-specified": Object {
"configs": Array [
Object {
@ -3624,6 +3772,32 @@ Object {
"multiple": false,
"simpleType": "boolean",
},
"resolve-loader-imports-fields": Object {
"configs": Array [
Object {
"description": "Field name from the description file (usually package.json) which is used to provide internal request of a package (requests starting with # are considered as internal).",
"multiple": true,
"path": "resolveLoader.importsFields[]",
"type": "string",
},
],
"description": "Field name from the description file (usually package.json) which is used to provide internal request of a package (requests starting with # are considered as internal).",
"multiple": true,
"simpleType": "string",
},
"resolve-loader-imports-fields-reset": Object {
"configs": Array [
Object {
"description": "Clear all items provided in configuration. Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).",
"multiple": false,
"path": "resolveLoader.importsFields",
"type": "reset",
},
],
"description": "Clear all items provided in configuration. Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).",
"multiple": false,
"simpleType": "boolean",
},
"resolve-loader-main-fields": Object {
"configs": Array [
Object {

View File

@ -3,9 +3,9 @@
exports[`StatsTestCases should print correct stats for aggressive-splitting-entry 1`] = `
"fitting:
PublicPath: auto
asset fitting-3aa6a54e85f89651e5ae.js 15.4 KiB [emitted] [immutable]
asset fitting-0ef410f237b15bfe113d.js 1.9 KiB [emitted] [immutable]
asset fitting-256876500cd1e11ec846.js 1.9 KiB [emitted] [immutable]
asset fitting-3aa6a54e85f89651e5ae.js 15.4 KiB [emitted] [immutable]
asset fitting-e34e676a6c178b5d493b.js 1.08 KiB [emitted] [immutable]
Entrypoint main 19.2 KiB = fitting-256876500cd1e11ec846.js 1.9 KiB fitting-0ef410f237b15bfe113d.js 1.9 KiB fitting-3aa6a54e85f89651e5ae.js 15.4 KiB
chunk (runtime: main) fitting-3aa6a54e85f89651e5ae.js 1.87 KiB (javascript) 8.33 KiB (runtime) [entry] [rendered]
@ -30,9 +30,9 @@ exports[`StatsTestCases should print correct stats for aggressive-splitting-entr
content-change:
PublicPath: auto
asset content-change-6ace2c504d33379804e9.js 15.4 KiB [emitted] [immutable]
asset content-change-0ef410f237b15bfe113d.js 1.9 KiB [emitted] [immutable]
asset content-change-256876500cd1e11ec846.js 1.9 KiB [emitted] [immutable]
asset content-change-6ace2c504d33379804e9.js 15.4 KiB [emitted] [immutable]
asset content-change-e34e676a6c178b5d493b.js 1.08 KiB [emitted] [immutable]
Entrypoint main 19.3 KiB = content-change-256876500cd1e11ec846.js 1.9 KiB content-change-0ef410f237b15bfe113d.js 1.9 KiB content-change-6ace2c504d33379804e9.js 15.4 KiB
chunk (runtime: main) content-change-6ace2c504d33379804e9.js 1.87 KiB (javascript) 8.33 KiB (runtime) [entry] [rendered]
@ -59,16 +59,16 @@ content-change:
exports[`StatsTestCases should print correct stats for aggressive-splitting-on-demand 1`] = `
"PublicPath: auto
asset 0080aa228e232e439083.js 11.5 KiB [emitted] [immutable] (name: main)
asset 0ef410f237b15bfe113d.js 1.9 KiB [emitted] [immutable]
asset 1ec205e8858a643a9384.js 1.9 KiB [emitted] [immutable]
asset 268151d0ecbaa017b6b2.js 1010 bytes [emitted] [immutable]
asset 2bc30c0edd0c9fa06940.js 1.91 KiB [emitted] [immutable]
asset 2c48ceffba3f9f1b8eeb.js 1.9 KiB [emitted] [immutable]
asset 3e1803ff13e39980e126.js 1.9 KiB [emitted] [immutable]
asset 6ce2fc05ded2844a80cb.js 1.91 KiB [emitted] [immutable]
asset 1ec205e8858a643a9384.js 1.9 KiB [emitted] [immutable]
asset 3e1803ff13e39980e126.js 1.9 KiB [emitted] [immutable]
asset 0ef410f237b15bfe113d.js 1.9 KiB [emitted] [immutable]
asset 2c48ceffba3f9f1b8eeb.js 1.9 KiB [emitted] [immutable]
asset 78b089fd6e93e03b503b.js 1.9 KiB [emitted] [immutable]
asset d12a3594bf404e747097.js 1010 bytes [emitted] [immutable]
asset d5a367eaab9f5bb1a8c2.js 1.9 KiB [emitted] [immutable]
asset 268151d0ecbaa017b6b2.js 1010 bytes [emitted] [immutable]
asset d12a3594bf404e747097.js 1010 bytes [emitted] [immutable]
asset d9923f4628103bfc54b5.js 1010 bytes [emitted] [immutable]
Entrypoint main 11.5 KiB = 0080aa228e232e439083.js
chunk (runtime: main) 0ef410f237b15bfe113d.js 1.76 KiB [rendered] [recorded] aggressive splitted
@ -470,10 +470,10 @@ webpack x.x.x compiled successfully in X ms"
exports[`StatsTestCases should print correct stats for chunks 1`] = `
"PublicPath: auto
asset bundle.js 9.98 KiB [emitted] (name: main)
asset 460.bundle.js 320 bytes [emitted]
asset 524.bundle.js 206 bytes [emitted]
asset 996.bundle.js 138 bytes [emitted]
asset bundle.js 9.98 KiB [emitted] (name: main)
chunk (runtime: main) bundle.js (main) 73 bytes (javascript) 5.88 KiB (runtime) >{460}< >{996}< [entry] [rendered]
> ./index main
runtime modules 5.88 KiB 7 modules
@ -516,10 +516,10 @@ webpack x.x.x compiled successfully in X ms"
exports[`StatsTestCases should print correct stats for chunks-development 1`] = `
"PublicPath: auto
asset b_js.bundle.js 964 bytes [emitted]
asset bundle.js 11.1 KiB [emitted] (name: main)
asset c_js.bundle.js 1.1 KiB [emitted]
asset d_js-e_js.bundle.js 1.37 KiB [emitted]
asset c_js.bundle.js 1.1 KiB [emitted]
asset b_js.bundle.js 964 bytes [emitted]
chunk b_js.bundle.js 22 bytes <{main}> [rendered]
> ./b ./index.js 2:0-16
./b.js 22 bytes [built] [code generated]
@ -603,8 +603,8 @@ webpack x.x.x compiled successfully in X ms"
`;
exports[`StatsTestCases should print correct stats for commons-chunk-min-size-0 1`] = `
"asset 429.js 274 bytes [emitted] (id hint: vendor-1)
asset entry-1.js 5.55 KiB [emitted] (name: entry-1)
"asset entry-1.js 5.55 KiB [emitted] (name: entry-1)
asset 429.js 274 bytes [emitted] (id hint: vendor-1)
Entrypoint entry-1 5.82 KiB = 429.js 274 bytes entry-1.js 5.55 KiB
runtime modules 2.58 KiB 2 modules
modules by path ./modules/ 132 bytes
@ -676,10 +676,10 @@ exports[`StatsTestCases should print correct stats for concat-and-sideeffects 1`
`;
exports[`StatsTestCases should print correct stats for context-independence 1`] = `
"asset 664-b8f1eb47758a24f778d7.js 453 bytes [emitted] [immutable]
sourceMap 664-b8f1eb47758a24f778d7.js.map 344 bytes [emitted] [dev]
asset main-dca06026a5b0027faf40.js 10.3 KiB [emitted] [immutable] (name: main)
"asset main-dca06026a5b0027faf40.js 10.3 KiB [emitted] [immutable] (name: main)
sourceMap main-dca06026a5b0027faf40.js.map 9.16 KiB [emitted] [dev] (auxiliary name: main)
asset 664-b8f1eb47758a24f778d7.js 453 bytes [emitted] [immutable]
sourceMap 664-b8f1eb47758a24f778d7.js.map 344 bytes [emitted] [dev]
runtime modules 6.17 KiB 8 modules
orphan modules 19 bytes [orphan] 1 module
cacheable modules 106 bytes
@ -687,10 +687,10 @@ cacheable modules 106 bytes
./a/chunk.js + 1 modules 66 bytes [built] [code generated]
webpack x.x.x compiled successfully in X ms
asset 664-b8f1eb47758a24f778d7.js 453 bytes [emitted] [immutable]
sourceMap 664-b8f1eb47758a24f778d7.js.map 344 bytes [emitted] [dev]
asset main-dca06026a5b0027faf40.js 10.3 KiB [emitted] [immutable] (name: main)
sourceMap main-dca06026a5b0027faf40.js.map 9.16 KiB [emitted] [dev] (auxiliary name: main)
asset 664-b8f1eb47758a24f778d7.js 453 bytes [emitted] [immutable]
sourceMap 664-b8f1eb47758a24f778d7.js.map 344 bytes [emitted] [dev]
runtime modules 6.17 KiB 8 modules
orphan modules 19 bytes [orphan] 1 module
cacheable modules 106 bytes
@ -698,8 +698,8 @@ cacheable modules 106 bytes
./b/chunk.js + 1 modules 66 bytes [built] [code generated]
webpack x.x.x compiled successfully in X ms
asset 664-621821b58c4f6e28e877.js 1.51 KiB [emitted] [immutable]
asset main-d55c218ddb324e3dea19.js 11.1 KiB [emitted] [immutable] (name: main)
asset 664-621821b58c4f6e28e877.js 1.51 KiB [emitted] [immutable]
runtime modules 6.17 KiB 8 modules
orphan modules 19 bytes [orphan] 1 module
cacheable modules 106 bytes
@ -707,8 +707,8 @@ cacheable modules 106 bytes
./a/chunk.js + 1 modules 66 bytes [built] [code generated]
webpack x.x.x compiled successfully in X ms
asset 664-621821b58c4f6e28e877.js 1.51 KiB [emitted] [immutable]
asset main-d55c218ddb324e3dea19.js 11.1 KiB [emitted] [immutable] (name: main)
asset 664-621821b58c4f6e28e877.js 1.51 KiB [emitted] [immutable]
runtime modules 6.17 KiB 8 modules
orphan modules 19 bytes [orphan] 1 module
cacheable modules 106 bytes
@ -887,15 +887,15 @@ chunk trees.js (trees) 71 bytes [rendered]
`;
exports[`StatsTestCases should print correct stats for immutable 1`] = `
"asset b815a02217b4cae51059.js 884 bytes [emitted] [immutable]
asset c30341ca2ed860460ce7.js 12.5 KiB [emitted] [immutable] (name: main)"
"asset c30341ca2ed860460ce7.js 12.5 KiB [emitted] [immutable] (name: main)
asset b815a02217b4cae51059.js 884 bytes [emitted] [immutable]"
`;
exports[`StatsTestCases should print correct stats for import-context-filter 1`] = `
"asset 398.js 480 bytes [emitted]
"asset entry.js 11.7 KiB [emitted] (name: entry)
asset 398.js 480 bytes [emitted]
asset 544.js 480 bytes [emitted]
asset 718.js 480 bytes [emitted]
asset entry.js 11.7 KiB [emitted] (name: entry)
runtime modules 6.44 KiB 9 modules
built modules 724 bytes [built]
modules by path ./templates/*.js 114 bytes
@ -908,8 +908,8 @@ webpack x.x.x compiled successfully in X ms"
`;
exports[`StatsTestCases should print correct stats for import-weak 1`] = `
"asset 836.js 138 bytes [emitted]
asset entry.js 12.3 KiB [emitted] (name: entry)
"asset entry.js 12.3 KiB [emitted] (name: entry)
asset 836.js 138 bytes [emitted]
runtime modules 7.11 KiB 10 modules
orphan modules 37 bytes [orphan] 1 module
cacheable modules 142 bytes
@ -944,18 +944,18 @@ webpack x.x.x compiled with 3 warnings"
`;
exports[`StatsTestCases should print correct stats for issue-7577 1`] = `
"asset a-all-a_js-d34afd21aa7977571016.js 140 bytes [emitted] [immutable] (id hint: all)
"asset a-runtime~main-1c25d32f5799aad03d03.js 5.1 KiB [emitted] [immutable] (name: runtime~main)
asset a-all-a_js-d34afd21aa7977571016.js 140 bytes [emitted] [immutable] (id hint: all)
asset a-main-b1eee3373fffb0185d2b.js 114 bytes [emitted] [immutable] (name: main)
asset a-runtime~main-1c25d32f5799aad03d03.js 5.1 KiB [emitted] [immutable] (name: runtime~main)
Entrypoint main 5.35 KiB = a-runtime~main-1c25d32f5799aad03d03.js 5.1 KiB a-all-a_js-d34afd21aa7977571016.js 140 bytes a-main-b1eee3373fffb0185d2b.js 114 bytes
runtime modules 2.58 KiB 2 modules
./a.js 18 bytes [built] [code generated]
webpack x.x.x compiled successfully in X ms
asset b-all-b_js-2c51416a14123ef7c0b7.js 475 bytes [emitted] [immutable] (id hint: all)
asset b-main-0780253982d2b99627d2.js 147 bytes [emitted] [immutable] (name: main)
asset b-runtime~main-599255de31b112c7d98b.js 6.04 KiB [emitted] [immutable] (name: runtime~main)
asset b-all-b_js-2c51416a14123ef7c0b7.js 475 bytes [emitted] [immutable] (id hint: all)
asset b-vendors-node_modules_vendor_js-93fc2ac2d261c82b4448.js 185 bytes [emitted] [immutable] (id hint: vendors)
asset b-main-0780253982d2b99627d2.js 147 bytes [emitted] [immutable] (name: main)
Entrypoint main 6.83 KiB = b-runtime~main-599255de31b112c7d98b.js 6.04 KiB b-vendors-node_modules_vendor_js-93fc2ac2d261c82b4448.js 185 bytes b-all-b_js-2c51416a14123ef7c0b7.js 475 bytes b-main-0780253982d2b99627d2.js 147 bytes
runtime modules 3.14 KiB 4 modules
cacheable modules 40 bytes
@ -966,8 +966,8 @@ webpack x.x.x compiled successfully in X ms
assets by chunk 895 bytes (id hint: all)
asset c-all-b_js-5d2ee8f74cbe1c7c24e8.js 502 bytes [emitted] [immutable] (id hint: all)
asset c-all-c_js-3f22b3dd1aa1ecb5f45e.js 393 bytes [emitted] [immutable] (id hint: all)
asset c-main-3737497cd09f5bd99fe3.js 603 bytes [emitted] [immutable] (name: main)
asset c-runtime~main-9ceddf596724e4da4223.js 13.7 KiB [emitted] [immutable] (name: runtime~main)
asset c-main-3737497cd09f5bd99fe3.js 603 bytes [emitted] [immutable] (name: main)
asset c-vendors-node_modules_vendor_js-93fc2ac2d261c82b4448.js 185 bytes [emitted] [immutable] (id hint: vendors)
Entrypoint main 14.7 KiB = c-runtime~main-9ceddf596724e4da4223.js 13.7 KiB c-all-c_js-3f22b3dd1aa1ecb5f45e.js 393 bytes c-main-3737497cd09f5bd99fe3.js 603 bytes
runtime modules 8.81 KiB 12 modules
@ -993,8 +993,8 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin
1 chunks (webpack x.x.x) compiled successfully in X ms
2 chunks:
asset 459.bundle2.js 662 bytes [emitted] (name: c)
asset bundle2.js 11.9 KiB [emitted] (name: main)
asset 459.bundle2.js 662 bytes [emitted] (name: c)
chunk (runtime: main) bundle2.js (main) 101 bytes (javascript) 7.11 KiB (runtime) >{459}< [entry] [rendered]
runtime modules 7.11 KiB 10 modules
./index.js 101 bytes [built] [code generated]
@ -1008,9 +1008,9 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin
2 chunks (webpack x.x.x) compiled successfully in X ms
3 chunks:
asset bundle3.js 11.9 KiB [emitted] (name: main)
asset 459.bundle3.js 526 bytes [emitted] (name: c)
asset 524.bundle3.js 206 bytes [emitted]
asset bundle3.js 11.9 KiB [emitted] (name: main)
chunk (runtime: main) bundle3.js (main) 101 bytes (javascript) 7.11 KiB (runtime) >{459}< [entry] [rendered]
runtime modules 7.11 KiB 10 modules
./index.js 101 bytes [built] [code generated]
@ -1024,10 +1024,10 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin
3 chunks (webpack x.x.x) compiled successfully in X ms
4 chunks:
asset 394.bundle4.js 206 bytes [emitted]
asset 459.bundle4.js 390 bytes [emitted] (name: c)
asset 524.bundle4.js 206 bytes [emitted]
asset bundle4.js 11.9 KiB [emitted] (name: main)
asset 459.bundle4.js 390 bytes [emitted] (name: c)
asset 394.bundle4.js 206 bytes [emitted]
asset 524.bundle4.js 206 bytes [emitted]
chunk (runtime: main) bundle4.js (main) 101 bytes (javascript) 7.11 KiB (runtime) >{394}< >{459}< [entry] [rendered]
runtime modules 7.11 KiB 10 modules
./index.js 101 bytes [built] [code generated]
@ -1120,9 +1120,9 @@ webpack x.x.x compiled successfully in X ms"
exports[`StatsTestCases should print correct stats for module-assets 1`] = `
"assets by path *.js 11.6 KiB
asset main.js 10.3 KiB [emitted] (name: main)
asset a.js 744 bytes [emitted] (name: a)
asset b.js 563 bytes [emitted] (name: b)
asset main.js 10.3 KiB [emitted] (name: main)
assets by path *.png 42 KiB
asset 1.png 21 KiB [emitted] (auxiliary name: a)
asset 2.png 21 KiB [emitted] (auxiliary name: a, b)
@ -1150,15 +1150,15 @@ webpack x.x.x compiled successfully in X ms"
`;
exports[`StatsTestCases should print correct stats for module-deduplication 1`] = `
"asset 114.js 677 bytes [emitted]
asset 172.js 730 bytes [emitted]
asset 326.js 730 bytes [emitted]
asset 593.js 677 bytes [emitted]
asset 716.js 677 bytes [emitted]
asset 923.js 730 bytes [emitted]
asset e1.js 12.4 KiB [emitted] (name: e1)
"asset e1.js 12.4 KiB [emitted] (name: e1)
asset e2.js 12.4 KiB [emitted] (name: e2)
asset e3.js 12.4 KiB [emitted] (name: e3)
asset 172.js 730 bytes [emitted]
asset 326.js 730 bytes [emitted]
asset 923.js 730 bytes [emitted]
asset 114.js 677 bytes [emitted]
asset 593.js 677 bytes [emitted]
asset 716.js 677 bytes [emitted]
chunk (runtime: e1) 114.js 28 bytes [rendered]
./async1.js 28 bytes [built] [code generated]
chunk (runtime: e3) e3.js (e3) 152 bytes (javascript) 6.7 KiB (runtime) [entry] [rendered]
@ -1202,12 +1202,12 @@ webpack x.x.x compiled successfully"
`;
exports[`StatsTestCases should print correct stats for module-deduplication-named 1`] = `
"asset async1.js 835 bytes [emitted] (name: async1)
asset async2.js 835 bytes [emitted] (name: async2)
asset async3.js 835 bytes [emitted] (name: async3)
asset e1.js 12.2 KiB [emitted] (name: e1)
"asset e1.js 12.2 KiB [emitted] (name: e1)
asset e2.js 12.2 KiB [emitted] (name: e2)
asset e3.js 12.2 KiB [emitted] (name: e3)
asset async1.js 835 bytes [emitted] (name: async1)
asset async2.js 835 bytes [emitted] (name: async2)
asset async3.js 835 bytes [emitted] (name: async3)
chunk (runtime: e3) e3.js (e3) 144 bytes (javascript) 6.74 KiB (runtime) [entry] [rendered]
runtime modules 6.74 KiB 10 modules
cacheable modules 144 bytes
@ -1253,7 +1253,7 @@ This is no longer the case. Verify if you need this module and configure a polyf
If you want to include a polyfill, you need to install 'buffer'.
If you don't want to include a polyfill, you can use an empty module like this:
resolve.alias: { \\"buffer\\": false }
resolve.fallback: { \\"buffer\\": false }
ERROR in ./index.js 2:0-13
Module not found: Error: Can't resolve 'os' in 'Xdir/module-not-found-error'
@ -1262,10 +1262,10 @@ BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add an alias 'resolve.alias: { \\"os\\": \\"os-browserify/browser\\" }'
- add an fallback 'resolve.fallback: { \\"os\\": \\"os-browserify/browser\\" }'
- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.alias: { \\"os\\": false }
resolve.fallback: { \\"os\\": false }
webpack compiled with 2 errors"
`;
@ -1423,14 +1423,14 @@ webpack x.x.x compiled with 1 warning in X ms"
`;
exports[`StatsTestCases should print correct stats for optimize-chunks 1`] = `
"asset ab.js 149 bytes {90} [emitted] (name: ab)
asset abd.js 193 bytes {90}, {374} [emitted] (name: abd)
asset ac in ab.js 110 bytes {753} [emitted] (name: ac in ab)
asset chunk.js 154 bytes {284}, {753} [emitted] (name: chunk)
asset cir1.js 330 bytes {592} [emitted] (name: cir1)
"asset main.js 10.8 KiB {179} [emitted] (name: main)
asset cir2 from cir1.js 374 bytes {288}, {289} [emitted] (name: cir2 from cir1)
asset cir1.js 330 bytes {592} [emitted] (name: cir1)
asset cir2.js 330 bytes {289} [emitted] (name: cir2)
asset main.js 10.8 KiB {179} [emitted] (name: main)
asset abd.js 193 bytes {90}, {374} [emitted] (name: abd)
asset chunk.js 154 bytes {284}, {753} [emitted] (name: chunk)
asset ab.js 149 bytes {90} [emitted] (name: ab)
asset ac in ab.js 110 bytes {753} [emitted] (name: ac in ab)
chunk {90} (runtime: main) ab.js (ab) 2 bytes <{179}> >{753}< [rendered]
> [10] ./index.js 1:0-6:8
./modules/a.js [839] 1 bytes {90} {374} [built] [code generated]
@ -1446,7 +1446,7 @@ chunk {284} (runtime: main) chunk.js (chunk) 2 bytes <{374}> <{753}> [rendered]
> [10] ./index.js 9:1-10:12
./modules/c.js [115] 1 bytes {284} {753} [built] [code generated]
./modules/d.js [928] 1 bytes {284} {374} [built] [code generated]
chunk {288} (runtime: main) cir2 from cir1.js (cir2 from cir1) 82 bytes <{592}> [rendered]
chunk {288} (runtime: main) cir2 from cir1.js (cir2 from cir1) 82 bytes <{592}> >{592}< [rendered]
> [655] ./circular1.js 1:0-79
./circular2.js [193] 81 bytes {288} {289} [built] [code generated]
./modules/e.js [798] 1 bytes {288} [built] [code generated]
@ -1458,7 +1458,7 @@ chunk {374} (runtime: main) abd.js (abd) 3 bytes <{179}> >{284}< [rendered]
./modules/a.js [839] 1 bytes {90} {374} [built] [code generated]
./modules/b.js [836] 1 bytes {90} {374} [built] [code generated]
./modules/d.js [928] 1 bytes {284} {374} [built] [code generated]
chunk {592} (runtime: main) cir1.js (cir1) 81 bytes <{179}> <{289}> >{288}< [rendered]
chunk {592} (runtime: main) cir1.js (cir1) 81 bytes <{179}> <{288}> <{289}> >{288}< [rendered]
> [10] ./index.js 13:0-54
> [193] ./circular2.js 1:0-79
./circular1.js [655] 81 bytes {592} [built] [code generated]
@ -1564,10 +1564,10 @@ webpack x.x.x compiled with 3 warnings in X ms"
`;
exports[`StatsTestCases should print correct stats for performance-disabled 1`] = `
"asset <CLR=32,BOLD>460.js</CLR> 320 bytes <CLR=32,BOLD>[emitted]</CLR>
"asset <CLR=32,BOLD>main.js</CLR> 303 KiB <CLR=32,BOLD>[emitted]</CLR> (name: main)
asset <CLR=32,BOLD>460.js</CLR> 320 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>524.js</CLR> 206 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>996.js</CLR> 138 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>main.js</CLR> 303 KiB <CLR=32,BOLD>[emitted]</CLR> (name: main)
Entrypoint <CLR=BOLD>main</CLR> 303 KiB = <CLR=32,BOLD>main.js</CLR>
runtime modules 5.87 KiB 7 modules
cacheable modules 293 KiB
@ -1581,10 +1581,10 @@ webpack x.x.x compiled <CLR=32,BOLD>successfully</CLR> in X ms"
`;
exports[`StatsTestCases should print correct stats for performance-error 1`] = `
"asset <CLR=32,BOLD>460.js</CLR> 320 bytes <CLR=32,BOLD>[emitted]</CLR>
"asset <CLR=33,BOLD>main.js</CLR> <CLR=33,BOLD>303 KiB</CLR> <CLR=32,BOLD>[emitted]</CLR> <CLR=33,BOLD>[big]</CLR> (name: main)
asset <CLR=32,BOLD>460.js</CLR> 320 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>524.js</CLR> 206 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>996.js</CLR> 138 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=33,BOLD>main.js</CLR> <CLR=33,BOLD>303 KiB</CLR> <CLR=32,BOLD>[emitted]</CLR> <CLR=33,BOLD>[big]</CLR> (name: main)
Entrypoint <CLR=BOLD>main</CLR> <CLR=33,BOLD>[big]</CLR> 303 KiB = <CLR=32,BOLD>main.js</CLR>
runtime modules 5.87 KiB 7 modules
cacheable modules 293 KiB
@ -1640,10 +1640,10 @@ webpack x.x.x compiled with <CLR=33,BOLD>3 warnings</CLR> in X ms"
`;
exports[`StatsTestCases should print correct stats for performance-no-hints 1`] = `
"asset <CLR=32,BOLD>460.js</CLR> 320 bytes <CLR=32,BOLD>[emitted]</CLR>
"asset <CLR=33,BOLD>main.js</CLR> <CLR=33,BOLD>303 KiB</CLR> <CLR=32,BOLD>[emitted]</CLR> <CLR=33,BOLD>[big]</CLR> (name: main)
asset <CLR=32,BOLD>460.js</CLR> 320 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>524.js</CLR> 206 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>996.js</CLR> 138 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=33,BOLD>main.js</CLR> <CLR=33,BOLD>303 KiB</CLR> <CLR=32,BOLD>[emitted]</CLR> <CLR=33,BOLD>[big]</CLR> (name: main)
Entrypoint <CLR=BOLD>main</CLR> <CLR=33,BOLD>[big]</CLR> 303 KiB = <CLR=32,BOLD>main.js</CLR>
runtime modules 5.87 KiB 7 modules
cacheable modules 293 KiB
@ -1687,13 +1687,13 @@ webpack x.x.x compiled with <CLR=31,BOLD>3 errors</CLR> in X ms"
`;
exports[`StatsTestCases should print correct stats for prefetch 1`] = `
"asset inner.js 110 bytes {746} [emitted] (name: inner)
asset inner2.js 150 bytes {641} [emitted] (name: inner2)
asset main.js 15.2 KiB {179} [emitted] (name: main)
asset normal.js 109 bytes {30} [emitted] (name: normal)
"asset main.js 15.2 KiB {179} [emitted] (name: main)
asset prefetched.js 553 bytes {505} [emitted] (name: prefetched)
asset inner2.js 150 bytes {641} [emitted] (name: inner2)
asset inner.js 110 bytes {746} [emitted] (name: inner)
asset prefetched2.js 110 bytes {379} [emitted] (name: prefetched2)
asset prefetched3.js 110 bytes {220} [emitted] (name: prefetched3)
asset normal.js 109 bytes {30} [emitted] (name: normal)
Entrypoint main 15.2 KiB = main.js
prefetch: prefetched2.js {379} (name: prefetched2), prefetched.js {505} (name: prefetched), prefetched3.js {220} (name: prefetched3)
chunk {30} (runtime: main) normal.js (normal) 1 bytes <{179}> [rendered]
@ -1720,11 +1720,11 @@ chunk (runtime: main) b2.js (b2) 1 bytes <{128}> [rendered]"
`;
exports[`StatsTestCases should print correct stats for preload 1`] = `
"asset inner.js 110 bytes [emitted] (name: inner)
asset inner2.js 150 bytes [emitted] (name: inner2)
asset main.js 14.5 KiB [emitted] (name: main)
asset normal.js 109 bytes [emitted] (name: normal)
"asset main.js 14.5 KiB [emitted] (name: main)
asset preloaded.js 553 bytes [emitted] (name: preloaded)
asset inner2.js 150 bytes [emitted] (name: inner2)
asset inner.js 110 bytes [emitted] (name: inner)
asset normal.js 109 bytes [emitted] (name: normal)
asset preloaded2.js 109 bytes [emitted] (name: preloaded2)
asset preloaded3.js 108 bytes [emitted] (name: preloaded3)
Entrypoint main 14.5 KiB = main.js
@ -1748,10 +1748,10 @@ exports[`StatsTestCases should print correct stats for preset-detailed 1`] = `
[LogTestPlugin] Log
[LogTestPlugin] End
PublicPath: auto
asset main.js 9.97 KiB {179} [emitted] (name: main)
asset 460.js 320 bytes {460} [emitted]
asset 524.js 206 bytes {524} [emitted]
asset 996.js 138 bytes {996} [emitted]
asset main.js 9.97 KiB {179} [emitted] (name: main)
Entrypoint main 9.97 KiB = main.js
chunk {179} (runtime: main) main.js (main) 73 bytes (javascript) 5.87 KiB (runtime) >{460}< >{996}< [entry] [rendered]
> ./index main
@ -1918,10 +1918,10 @@ exports[`StatsTestCases should print correct stats for preset-normal 1`] = `
"<e> [LogTestPlugin] Error
<w> [LogTestPlugin] Warning
<i> [LogTestPlugin] Info
asset main.js 9.97 KiB [emitted] (name: main)
asset 460.js 320 bytes [emitted]
asset 524.js 206 bytes [emitted]
asset 996.js 138 bytes [emitted]
asset main.js 9.97 KiB [emitted] (name: main)
runtime modules 5.87 KiB 7 modules
cacheable modules 193 bytes
./index.js 51 bytes [built] [code generated]
@ -1941,10 +1941,10 @@ webpack x.x.x compiled successfully in X ms"
`;
exports[`StatsTestCases should print correct stats for preset-normal-performance 1`] = `
"asset <CLR=32,BOLD>460.js</CLR> 320 bytes <CLR=32,BOLD>[emitted]</CLR>
"asset <CLR=33,BOLD>main.js</CLR> <CLR=33,BOLD>303 KiB</CLR> <CLR=32,BOLD>[emitted]</CLR> <CLR=33,BOLD>[big]</CLR> (name: main)
asset <CLR=32,BOLD>460.js</CLR> 320 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>524.js</CLR> 206 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>996.js</CLR> 138 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=33,BOLD>main.js</CLR> <CLR=33,BOLD>303 KiB</CLR> <CLR=32,BOLD>[emitted]</CLR> <CLR=33,BOLD>[big]</CLR> (name: main)
runtime modules 5.87 KiB 7 modules
cacheable modules 293 KiB
<CLR=BOLD>./index.js</CLR> 52 bytes <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR>
@ -1969,10 +1969,10 @@ webpack x.x.x compiled with <CLR=33,BOLD>2 warnings</CLR> in X ms"
`;
exports[`StatsTestCases should print correct stats for preset-normal-performance-ensure-filter-sourcemaps 1`] = `
"asset <CLR=32,BOLD>460.js</CLR> 352 bytes <CLR=32,BOLD>[emitted]</CLR> 1 related asset
"asset <CLR=33,BOLD>main.js</CLR> <CLR=33,BOLD>303 KiB</CLR> <CLR=32,BOLD>[emitted]</CLR> <CLR=33,BOLD>[big]</CLR> (name: main) 1 related asset
asset <CLR=32,BOLD>460.js</CLR> 352 bytes <CLR=32,BOLD>[emitted]</CLR> 1 related asset
asset <CLR=32,BOLD>524.js</CLR> 238 bytes <CLR=32,BOLD>[emitted]</CLR> 1 related asset
asset <CLR=32,BOLD>996.js</CLR> 170 bytes <CLR=32,BOLD>[emitted]</CLR> 1 related asset
asset <CLR=33,BOLD>main.js</CLR> <CLR=33,BOLD>303 KiB</CLR> <CLR=32,BOLD>[emitted]</CLR> <CLR=33,BOLD>[big]</CLR> (name: main) 1 related asset
runtime modules 5.87 KiB 7 modules
cacheable modules 293 KiB
<CLR=BOLD>./index.js</CLR> 52 bytes <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR>
@ -2016,10 +2016,10 @@ exports[`StatsTestCases should print correct stats for preset-verbose 1`] = `
[LogTestPlugin] Log
[LogTestPlugin] End
PublicPath: auto
asset main.js 9.97 KiB {179} [emitted] (name: main)
asset 460.js 320 bytes {460} [emitted]
asset 524.js 206 bytes {524} [emitted]
asset 996.js 138 bytes {996} [emitted]
asset main.js 9.97 KiB {179} [emitted] (name: main)
Entrypoint main 9.97 KiB = main.js
chunk {179} (runtime: main) main.js (main) 73 bytes (javascript) 5.87 KiB (runtime) >{460}< >{996}< [entry] [rendered]
> ./index main
@ -2189,12 +2189,12 @@ LOG from webpack.FileSystemInfo
exports[`StatsTestCases should print correct stats for real-content-hash 1`] = `
"a-normal:
assets by path *.js 2.98 KiB
asset 2cc3ac5aa5440f28a6f9-2cc3ac.js 2.59 KiB [emitted] [immutable] [minimized] (name: runtime~main)
asset 24cfa5c05911cd5cbbd1-24cfa5.js 2.59 KiB [emitted] [immutable] [minimized] (name: runtime~main)
asset 3cc8faad16137711c07e-3cc8fa.js 210 bytes [emitted] [immutable] [minimized] (name: main)
asset b6f77787a670e97d47b5-b6f777.js 193 bytes [emitted] [immutable] [minimized] (name: lazy)
asset 7382fad5b015914e0811.jpg 5.89 KiB [emitted] [immutable] (auxiliary name: main)
asset 89a353e9c515885abd8e.png 14.6 KiB [emitted] [immutable] (auxiliary name: lazy)
Entrypoint main 2.8 KiB (5.89 KiB) = 2cc3ac5aa5440f28a6f9-2cc3ac.js 2.59 KiB 3cc8faad16137711c07e-3cc8fa.js 210 bytes 1 auxiliary asset
asset 7382fad5b015914e0811.jpg 5.89 KiB [emitted] [immutable] (auxiliary name: main)
Entrypoint main 2.8 KiB (5.89 KiB) = 24cfa5c05911cd5cbbd1-24cfa5.js 2.59 KiB 3cc8faad16137711c07e-3cc8fa.js 210 bytes 1 auxiliary asset
runtime modules 7.36 KiB 8 modules
orphan modules 23 bytes [orphan] 1 module
cacheable modules 340 bytes (javascript) 20.4 KiB (asset)
@ -2208,12 +2208,12 @@ exports[`StatsTestCases should print correct stats for real-content-hash 1`] = `
b-normal:
assets by path *.js 2.98 KiB
asset 24cfa5c05911cd5cbbd1-24cfa5.js 2.59 KiB [emitted] [immutable] [minimized] (name: runtime~main)
asset 2cc3ac5aa5440f28a6f9-2cc3ac.js 2.59 KiB [emitted] [immutable] [minimized] (name: runtime~main)
asset 3cc8faad16137711c07e-3cc8fa.js 210 bytes [emitted] [immutable] [minimized] (name: main)
asset b6f77787a670e97d47b5-b6f777.js 193 bytes [emitted] [immutable] [minimized] (name: lazy)
asset 7382fad5b015914e0811.jpg 5.89 KiB [emitted] [immutable] (auxiliary name: main)
asset 89a353e9c515885abd8e.png 14.6 KiB [emitted] [immutable] (auxiliary name: lazy)
Entrypoint main 2.8 KiB (5.89 KiB) = 24cfa5c05911cd5cbbd1-24cfa5.js 2.59 KiB 3cc8faad16137711c07e-3cc8fa.js 210 bytes 1 auxiliary asset
asset 7382fad5b015914e0811.jpg 5.89 KiB [emitted] [immutable] (auxiliary name: main)
Entrypoint main 2.8 KiB (5.89 KiB) = 2cc3ac5aa5440f28a6f9-2cc3ac.js 2.59 KiB 3cc8faad16137711c07e-3cc8fa.js 210 bytes 1 auxiliary asset
runtime modules 7.36 KiB 8 modules
orphan modules 19 bytes [orphan] 1 module
cacheable modules 295 bytes (javascript) 20.4 KiB (asset)
@ -2227,15 +2227,15 @@ b-normal:
a-source-map:
assets by path *.js 3.15 KiB
asset 24c0cd320ce296ce77e9-24c0cd.js 2.65 KiB [emitted] [immutable] [minimized] (name: runtime~main)
sourceMap 24c0cd320ce296ce77e9-24c0cd.js.map 14.3 KiB [emitted] [dev] (auxiliary name: runtime~main)
asset 96f5411885597e14bcfb-96f541.js 2.65 KiB [emitted] [immutable] [minimized] (name: runtime~main)
sourceMap 96f5411885597e14bcfb-96f541.js.map 14.3 KiB [emitted] [dev] (auxiliary name: runtime~main)
asset b8bfcec62cdd15c9a840-b8bfce.js 266 bytes [emitted] [immutable] [minimized] (name: main)
sourceMap b8bfcec62cdd15c9a840-b8bfce.js.map 366 bytes [emitted] [dev] (auxiliary name: main)
asset c7c0f8bb2e61b59a89f5-c7c0f8.js 249 bytes [emitted] [immutable] [minimized] (name: lazy)
sourceMap c7c0f8bb2e61b59a89f5-c7c0f8.js.map 331 bytes [emitted] [dev] (auxiliary name: lazy)
asset 7382fad5b015914e0811.jpg 5.89 KiB [emitted] [immutable] (auxiliary name: main)
asset 89a353e9c515885abd8e.png 14.6 KiB [emitted] [immutable] (auxiliary name: lazy)
Entrypoint main 2.91 KiB (20.5 KiB) = 24c0cd320ce296ce77e9-24c0cd.js 2.65 KiB b8bfcec62cdd15c9a840-b8bfce.js 266 bytes 3 auxiliary assets
asset 7382fad5b015914e0811.jpg 5.89 KiB [emitted] [immutable] (auxiliary name: main)
Entrypoint main 2.91 KiB (20.5 KiB) = 96f5411885597e14bcfb-96f541.js 2.65 KiB b8bfcec62cdd15c9a840-b8bfce.js 266 bytes 3 auxiliary assets
runtime modules 7.36 KiB 8 modules
orphan modules 23 bytes [orphan] 1 module
cacheable modules 340 bytes (javascript) 20.4 KiB (asset)
@ -2249,15 +2249,15 @@ a-source-map:
b-source-map:
assets by path *.js 3.15 KiB
asset 96f5411885597e14bcfb-96f541.js 2.65 KiB [emitted] [immutable] [minimized] (name: runtime~main)
sourceMap 96f5411885597e14bcfb-96f541.js.map 14.3 KiB [emitted] [dev] (auxiliary name: runtime~main)
asset 24c0cd320ce296ce77e9-24c0cd.js 2.65 KiB [emitted] [immutable] [minimized] (name: runtime~main)
sourceMap 24c0cd320ce296ce77e9-24c0cd.js.map 14.3 KiB [emitted] [dev] (auxiliary name: runtime~main)
asset b8bfcec62cdd15c9a840-b8bfce.js 266 bytes [emitted] [immutable] [minimized] (name: main)
sourceMap b8bfcec62cdd15c9a840-b8bfce.js.map 323 bytes [emitted] [dev] (auxiliary name: main)
asset c7c0f8bb2e61b59a89f5-c7c0f8.js 249 bytes [emitted] [immutable] [minimized] (name: lazy)
sourceMap c7c0f8bb2e61b59a89f5-c7c0f8.js.map 327 bytes [emitted] [dev] (auxiliary name: lazy)
asset 7382fad5b015914e0811.jpg 5.89 KiB [emitted] [immutable] (auxiliary name: main)
asset 89a353e9c515885abd8e.png 14.6 KiB [emitted] [immutable] (auxiliary name: lazy)
Entrypoint main 2.91 KiB (20.5 KiB) = 96f5411885597e14bcfb-96f541.js 2.65 KiB b8bfcec62cdd15c9a840-b8bfce.js 266 bytes 3 auxiliary assets
asset 7382fad5b015914e0811.jpg 5.89 KiB [emitted] [immutable] (auxiliary name: main)
Entrypoint main 2.91 KiB (20.5 KiB) = 24c0cd320ce296ce77e9-24c0cd.js 2.65 KiB b8bfcec62cdd15c9a840-b8bfce.js 266 bytes 3 auxiliary assets
runtime modules 7.36 KiB 8 modules
orphan modules 19 bytes [orphan] 1 module
cacheable modules 295 bytes (javascript) 20.4 KiB (asset)
@ -2272,42 +2272,55 @@ b-source-map:
exports[`StatsTestCases should print correct stats for related-assets 1`] = `
"default:
assets by path *.js 15.8 KiB
asset default-main.js 14.6 KiB [emitted] (name: main) 3 related assets
asset default-chunk_js.js 1.11 KiB [emitted] 3 related assets
assets by path *.css 142 bytes
asset default-chunk_js.css 73 bytes [emitted] 3 related assets
asset default-main.css 69 bytes [emitted] (name: main) 3 related assets
assets by path *.js 15.8 KiB
asset default-chunk_js.js 1.11 KiB [emitted] 3 related assets
asset default-main.js 14.6 KiB [emitted] (name: main) 3 related assets
relatedAssets:
assets by path *.css 154 bytes
asset relatedAssets-chunk_js.css 79 bytes [emitted]
compressed relatedAssets-chunk_js.css.br 79 bytes [emitted]
compressed relatedAssets-chunk_js.css.gz 79 bytes [emitted]
sourceMap relatedAssets-chunk_js.css.map 197 bytes [emitted] [dev]
compressed relatedAssets-chunk_js.css.map.br 197 bytes [emitted]
compressed relatedAssets-chunk_js.css.map.gz 197 bytes [emitted]
asset relatedAssets-main.css 75 bytes [emitted] (name: main)
compressed relatedAssets-main.css.br 75 bytes [emitted]
compressed relatedAssets-main.css.gz 75 bytes [emitted]
sourceMap relatedAssets-main.css.map 187 bytes [emitted] [dev] (auxiliary name: main)
compressed relatedAssets-main.css.map.br 187 bytes [emitted]
compressed relatedAssets-main.css.map.gz 187 bytes [emitted]
assets by path *.js 15.8 KiB
asset relatedAssets-chunk_js.js 1.12 KiB [emitted]
compressed relatedAssets-chunk_js.js.br 1.12 KiB [emitted]
compressed relatedAssets-chunk_js.js.gz 1.12 KiB [emitted]
sourceMap relatedAssets-chunk_js.js.map 295 bytes [emitted] [dev]
compressed relatedAssets-chunk_js.js.map.br 295 bytes [emitted]
compressed relatedAssets-chunk_js.js.map.gz 295 bytes [emitted]
asset relatedAssets-main.js 14.7 KiB [emitted] (name: main)
compressed relatedAssets-main.js.br 14.7 KiB [emitted]
compressed relatedAssets-main.js.gz 14.7 KiB [emitted]
sourceMap relatedAssets-main.js.map 12.6 KiB [emitted] [dev] (auxiliary name: main)
compressed relatedAssets-main.js.map.br 12.6 KiB [emitted]
compressed relatedAssets-main.js.map.gz 12.6 KiB [emitted]
asset relatedAssets-chunk_js.js 1.12 KiB [emitted]
compressed relatedAssets-chunk_js.js.br 1.12 KiB [emitted]
compressed relatedAssets-chunk_js.js.gz 1.12 KiB [emitted]
sourceMap relatedAssets-chunk_js.js.map 295 bytes [emitted] [dev]
compressed relatedAssets-chunk_js.js.map.br 295 bytes [emitted]
compressed relatedAssets-chunk_js.js.map.gz 295 bytes [emitted]
assets by path *.css 154 bytes
asset relatedAssets-chunk_js.css 79 bytes [emitted]
sourceMap relatedAssets-chunk_js.css.map 197 bytes [emitted] [dev]
compressed relatedAssets-chunk_js.css.map.br 197 bytes [emitted]
compressed relatedAssets-chunk_js.css.map.gz 197 bytes [emitted]
compressed relatedAssets-chunk_js.css.br 79 bytes [emitted]
compressed relatedAssets-chunk_js.css.gz 79 bytes [emitted]
asset relatedAssets-main.css 75 bytes [emitted] (name: main)
sourceMap relatedAssets-main.css.map 187 bytes [emitted] [dev] (auxiliary name: main)
compressed relatedAssets-main.css.map.br 187 bytes [emitted]
compressed relatedAssets-main.css.map.gz 187 bytes [emitted]
compressed relatedAssets-main.css.br 75 bytes [emitted]
compressed relatedAssets-main.css.gz 75 bytes [emitted]
exclude1:
assets by path *.js 15.8 KiB
asset exclude1-main.js 14.6 KiB [emitted] (name: main)
hidden assets 29.3 KiB 2 assets
sourceMap exclude1-main.js.map 12.6 KiB [emitted] [dev] (auxiliary name: main)
hidden assets 25.2 KiB 2 assets
1 related asset
1 related asset
asset exclude1-chunk_js.js 1.11 KiB [emitted]
hidden assets 2.22 KiB 2 assets
sourceMap exclude1-chunk_js.js.map 290 bytes [emitted] [dev]
hidden assets 580 bytes 2 assets
1 related asset
1 related asset
assets by path *.css 144 bytes
asset exclude1-chunk_js.css 74 bytes [emitted]
hidden assets 148 bytes 2 assets
@ -2321,21 +2334,17 @@ exclude1:
hidden assets 364 bytes 2 assets
1 related asset
1 related asset
assets by path *.js 15.8 KiB
asset exclude1-chunk_js.js 1.11 KiB [emitted]
hidden assets 2.22 KiB 2 assets
sourceMap exclude1-chunk_js.js.map 290 bytes [emitted] [dev]
hidden assets 580 bytes 2 assets
1 related asset
1 related asset
asset exclude1-main.js 14.6 KiB [emitted] (name: main)
hidden assets 29.3 KiB 2 assets
sourceMap exclude1-main.js.map 12.6 KiB [emitted] [dev] (auxiliary name: main)
hidden assets 25.2 KiB 2 assets
1 related asset
1 related asset
exclude2:
assets by path *.js 15.8 KiB
asset exclude2-main.js 14.6 KiB [emitted] (name: main)
hidden assets 12.6 KiB 1 asset
compressed exclude2-main.js.br 14.6 KiB [emitted]
compressed exclude2-main.js.gz 14.6 KiB [emitted]
asset exclude2-chunk_js.js 1.11 KiB [emitted]
hidden assets 290 bytes 1 asset
compressed exclude2-chunk_js.js.br 1.11 KiB [emitted]
compressed exclude2-chunk_js.js.gz 1.11 KiB [emitted]
assets by path *.css 144 bytes
asset exclude2-chunk_js.css 74 bytes [emitted]
hidden assets 192 bytes 1 asset
@ -2345,31 +2354,22 @@ exclude2:
hidden assets 182 bytes 1 asset
compressed exclude2-main.css.br 70 bytes [emitted]
compressed exclude2-main.css.gz 70 bytes [emitted]
assets by path *.js 15.8 KiB
asset exclude2-chunk_js.js 1.11 KiB [emitted]
hidden assets 290 bytes 1 asset
compressed exclude2-chunk_js.js.br 1.11 KiB [emitted]
compressed exclude2-chunk_js.js.gz 1.11 KiB [emitted]
asset exclude2-main.js 14.6 KiB [emitted] (name: main)
hidden assets 12.6 KiB 1 asset
compressed exclude2-main.js.br 14.6 KiB [emitted]
compressed exclude2-main.js.gz 14.6 KiB [emitted]
exclude3:
hidden assets 1.18 KiB 2 assets
assets by status 14.7 KiB [emitted]
asset exclude3-main.css 70 bytes [emitted] (name: main)
compressed exclude3-main.css.br 70 bytes [emitted]
compressed exclude3-main.css.gz 70 bytes [emitted]
sourceMap exclude3-main.css.map 182 bytes [emitted] [dev] (auxiliary name: main)
compressed exclude3-main.css.map.br 182 bytes [emitted]
compressed exclude3-main.css.map.gz 182 bytes [emitted]
asset exclude3-main.js 14.6 KiB [emitted] (name: main)
compressed exclude3-main.js.br 14.6 KiB [emitted]
compressed exclude3-main.js.gz 14.6 KiB [emitted]
sourceMap exclude3-main.js.map 12.6 KiB [emitted] [dev] (auxiliary name: main)
compressed exclude3-main.js.map.br 12.6 KiB [emitted]
compressed exclude3-main.js.map.gz 12.6 KiB [emitted]"
compressed exclude3-main.js.map.gz 12.6 KiB [emitted]
asset exclude3-main.css 70 bytes [emitted] (name: main)
sourceMap exclude3-main.css.map 182 bytes [emitted] [dev] (auxiliary name: main)
compressed exclude3-main.css.map.br 182 bytes [emitted]
compressed exclude3-main.css.map.gz 182 bytes [emitted]
compressed exclude3-main.css.br 70 bytes [emitted]
compressed exclude3-main.css.gz 70 bytes [emitted]"
`;
exports[`StatsTestCases should print correct stats for resolve-plugin-context 1`] = `
@ -2427,9 +2427,9 @@ webpack x.x.x compiled successfully"
exports[`StatsTestCases should print correct stats for runtime-chunk-integration 1`] = `
"base:
asset without-runtime.js 12.3 KiB [emitted] (name: runtime)
asset without-505.js 1.22 KiB [emitted]
asset without-main1.js 596 bytes [emitted] (name: main1)
asset without-runtime.js 12.3 KiB [emitted] (name: runtime)
Entrypoint main1 12.8 KiB = without-runtime.js 12.3 KiB without-main1.js 596 bytes
runtime modules 7.63 KiB 9 modules
cacheable modules 126 bytes
@ -2440,11 +2440,11 @@ exports[`StatsTestCases should print correct stats for runtime-chunk-integration
base (webpack x.x.x) compiled successfully
static custom name:
asset with-manifest.js 12.3 KiB [emitted] (name: manifest)
asset with-505.js 1.22 KiB [emitted]
asset with-main1.js 596 bytes [emitted] (name: main1)
asset with-main2.js 215 bytes [emitted] (name: main2)
asset with-main3.js 215 bytes [emitted] (name: main3)
asset with-manifest.js 12.3 KiB [emitted] (name: manifest)
Entrypoint main1 12.8 KiB = with-manifest.js 12.3 KiB with-main1.js 596 bytes
Entrypoint main2 12.5 KiB = with-manifest.js 12.3 KiB with-main2.js 215 bytes
Entrypoint main3 12.5 KiB = with-manifest.js 12.3 KiB with-main3.js 215 bytes
@ -2459,9 +2459,9 @@ static custom name:
static custom name (webpack x.x.x) compiled successfully
dynamic custom name:
asset func-505.js 1.22 KiB [emitted]
asset func-a.js 5.09 KiB [emitted] (name: a)
asset func-b.js 12.3 KiB [emitted] (name: b)
asset func-a.js 5.09 KiB [emitted] (name: a)
asset func-505.js 1.22 KiB [emitted]
asset func-main1.js 596 bytes [emitted] (name: main1)
asset func-main2.js 215 bytes [emitted] (name: main2)
asset func-main3.js 215 bytes [emitted] (name: main3)
@ -2495,12 +2495,12 @@ exports[`StatsTestCases should print correct stats for runtime-specific-used-exp
"production:
asset production-a.js 12.8 KiB [emitted] (name: a)
asset production-b.js 12.8 KiB [emitted] (name: b)
asset production-c.js 63 bytes [emitted] (name: c)
asset production-dw_js-_a6170.js 1.16 KiB [emitted]
asset production-dw_js-_a6171.js 1.16 KiB [emitted]
asset production-dx_js.js 1.16 KiB [emitted]
asset production-dy_js.js 1.14 KiB [emitted]
asset production-dz_js.js 1.14 KiB [emitted]
asset production-c.js 63 bytes [emitted] (name: c)
chunk (runtime: a) production-a.js (a) 605 bytes (javascript) 6.45 KiB (runtime) [entry] [rendered]
runtime modules 6.45 KiB 9 modules
cacheable modules 605 bytes
@ -2577,11 +2577,11 @@ exports[`StatsTestCases should print correct stats for runtime-specific-used-exp
development:
asset development-a.js 18.1 KiB [emitted] (name: a)
asset development-b.js 18.1 KiB [emitted] (name: b)
asset development-c.js 806 bytes [emitted] (name: c)
asset development-dw_js.js 3.15 KiB [emitted]
asset development-dx_js.js 3.15 KiB [emitted]
asset development-dy_js.js 3.15 KiB [emitted]
asset development-dz_js.js 3.15 KiB [emitted]
asset development-c.js 806 bytes [emitted] (name: c)
chunk development-a.js (a) 605 bytes (javascript) 6.45 KiB (runtime) [entry] [rendered]
runtime modules 6.45 KiB 9 modules
cacheable modules 605 bytes
@ -2662,11 +2662,11 @@ development:
global:
asset global-a.js 13 KiB [emitted] (name: a)
asset global-b.js 13 KiB [emitted] (name: b)
asset global-c.js 63 bytes [emitted] (name: c)
asset global-dw_js.js 1.16 KiB [emitted]
asset global-dx_js.js 1.16 KiB [emitted]
asset global-dy_js.js 1.16 KiB [emitted]
asset global-dz_js.js 1.16 KiB [emitted]
asset global-c.js 63 bytes [emitted] (name: c)
chunk global-a.js (a) 605 bytes (javascript) 6.45 KiB (runtime) [entry] [rendered]
runtime modules 6.45 KiB 9 modules
cacheable modules 605 bytes
@ -2793,8 +2793,8 @@ webpack x.x.x compiled successfully in X ms"
`;
exports[`StatsTestCases should print correct stats for side-effects-issue-7428 1`] = `
"asset 1.js 638 bytes [emitted]
asset main.js 12 KiB [emitted] (name: main)
"asset main.js 12 KiB [emitted] (name: main)
asset 1.js 638 bytes [emitted]
runtime modules 6.44 KiB 9 modules
cacheable modules 823 bytes
modules by path ./components/src/ 501 bytes
@ -3990,10 +3990,10 @@ webpack x.x.x compiled successfully"
exports[`StatsTestCases should print correct stats for split-chunks-runtime-specific 1`] = `
"used-exports:
asset used-exports-c.js 5.88 KiB [emitted] (name: c)
asset used-exports-b.js 5.88 KiB [emitted] (name: b)
asset used-exports-332.js 422 bytes [emitted]
asset used-exports-a.js 225 bytes [emitted] (name: a)
asset used-exports-b.js 5.88 KiB [emitted] (name: b)
asset used-exports-c.js 5.88 KiB [emitted] (name: c)
Entrypoint a 225 bytes = used-exports-a.js
Entrypoint b 6.29 KiB = used-exports-332.js 422 bytes used-exports-b.js 5.88 KiB
Entrypoint c 6.3 KiB = used-exports-332.js 422 bytes used-exports-c.js 5.88 KiB
@ -4010,10 +4010,10 @@ exports[`StatsTestCases should print correct stats for split-chunks-runtime-spec
used-exports (webpack x.x.x) compiled successfully in X ms
no-used-exports:
asset no-used-exports-332.js 443 bytes [emitted]
asset no-used-exports-c.js 5.88 KiB [emitted] (name: c)
asset no-used-exports-a.js 5.88 KiB [emitted] (name: a)
asset no-used-exports-b.js 5.88 KiB [emitted] (name: b)
asset no-used-exports-c.js 5.88 KiB [emitted] (name: c)
asset no-used-exports-332.js 443 bytes [emitted]
Entrypoint a 6.31 KiB = no-used-exports-332.js 443 bytes no-used-exports-a.js 5.88 KiB
Entrypoint b 6.31 KiB = no-used-exports-332.js 443 bytes no-used-exports-b.js 5.88 KiB
Entrypoint c 6.32 KiB = no-used-exports-332.js 443 bytes no-used-exports-c.js 5.88 KiB
@ -4031,10 +4031,10 @@ no-used-exports:
no-used-exports (webpack x.x.x) compiled successfully in X ms
global:
asset global-332.js 443 bytes [emitted]
asset global-c.js 5.88 KiB [emitted] (name: c)
asset global-a.js 5.88 KiB [emitted] (name: a)
asset global-b.js 5.88 KiB [emitted] (name: b)
asset global-c.js 5.88 KiB [emitted] (name: c)
asset global-332.js 443 bytes [emitted]
Entrypoint a 6.31 KiB = global-332.js 443 bytes global-a.js 5.88 KiB
Entrypoint b 6.31 KiB = global-332.js 443 bytes global-b.js 5.88 KiB
Entrypoint c 6.32 KiB = global-332.js 443 bytes global-c.js 5.88 KiB
@ -4094,19 +4094,19 @@ webpack x.x.x compiled with 1 warning in X ms"
exports[`StatsTestCases should print correct stats for wasm-explorer-examples-sync 1`] = `
"assets by path *.js 18.2 KiB
asset 230.bundle.js 242 bytes [emitted]
asset 325.bundle.js 3.78 KiB [emitted]
asset 526.bundle.js 364 bytes [emitted] (id hint: vendors)
asset 780.bundle.js 569 bytes [emitted]
asset 99.bundle.js 240 bytes [emitted]
asset bundle.js 13 KiB [emitted] (name: main)
asset 325.bundle.js 3.78 KiB [emitted]
asset 780.bundle.js 569 bytes [emitted]
asset 526.bundle.js 364 bytes [emitted] (id hint: vendors)
asset 230.bundle.js 242 bytes [emitted]
asset 99.bundle.js 240 bytes [emitted]
assets by path *.wasm 1.37 KiB
asset 32796a220f44b00723d7.module.wasm 156 bytes [emitted] [immutable]
asset 52ce624dd5de9c91cd19.module.wasm 531 bytes [emitted] [immutable]
asset 71ba3c2b7af4ee0e4b5c.module.wasm 120 bytes [emitted] [immutable]
asset 86f222634054d2a3b20f.module.wasm 154 bytes [emitted] [immutable]
asset 986b1b3cbdd7749989ee.module.wasm 290 bytes [emitted] [immutable]
asset 32796a220f44b00723d7.module.wasm 156 bytes [emitted] [immutable]
asset 86f222634054d2a3b20f.module.wasm 154 bytes [emitted] [immutable]
asset a938d40645ba21696ec8.module.wasm 154 bytes [emitted] [immutable]
asset 71ba3c2b7af4ee0e4b5c.module.wasm 120 bytes [emitted] [immutable]
chunk (runtime: main) 99.bundle.js 50 bytes (javascript) 531 bytes (webassembly) [rendered]
./duff.wasm 50 bytes (javascript) 531 bytes (webassembly) [built] [code generated]
chunk (runtime: main) bundle.js (main) 586 bytes (javascript) 6.96 KiB (runtime) [entry] [rendered]

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1,3 @@
module.exports = [
[/Can't resolve '.\/dependency'/, /Did you mean 'dependency\.js'\?/]
];

View File

@ -0,0 +1,5 @@
it("should not resolve without extension", async () => {
await expect(import("./module.mjs")).rejects.toMatchObject({
code: "MODULE_NOT_FOUND"
});
});

View File

@ -0,0 +1 @@
import "./dependency";

View File

@ -0,0 +1,2 @@
export default "a";
export { default as b, a as ba } from "container2/b";

View File

@ -0,0 +1,2 @@
export default "b";
export { default as a, b as ab } from "container/a";

View File

@ -0,0 +1,13 @@
it("should allow circular dependencies between containers (a)", async () => {
const { default: value, b, ba } = await import("container/a");
expect(value).toBe("a");
expect(b).toBe("b");
expect(ba).toBe("a");
});
it("should allow circular dependencies between containers (b)", async () => {
const { default: value, a, ab } = await import("container2/b");
expect(value).toBe("b");
expect(a).toBe("a");
expect(ab).toBe("b");
});

View File

@ -0,0 +1,5 @@
module.exports = {
findBundle() {
return "./main.js";
}
};

View File

@ -0,0 +1,31 @@
const { ModuleFederationPlugin } = require("../../../../").container;
function createConfig() {
return {
output: {
filename: "[name].js"
},
plugins: [
new ModuleFederationPlugin({
name: "container",
library: { type: "commonjs-module" },
exposes: ["./a"],
remotes: {
container2:
"promise Promise.resolve().then(() => require('./container2.js'))"
}
}),
new ModuleFederationPlugin({
name: "container2",
library: { type: "commonjs-module" },
exposes: ["./b"],
remotes: {
container:
"promise Promise.resolve().then(() => require('./container.js'))"
}
})
]
};
}
module.exports = createConfig();

View File

@ -0,0 +1,7 @@
it("should allow to work without shared modules", async () => {
await __webpack_init_sharing__("default");
const container = __non_webpack_require__("./container.js");
container.init(__webpack_share_scopes__.default);
const moduleFactory = await container.get("./module");
expect(moduleFactory().ok).toBe(true);
});

View File

@ -0,0 +1 @@
export const ok = true;

View File

@ -0,0 +1,13 @@
const { ModuleFederationPlugin } = require("../../../../").container;
/** @type {import("../../../../").Configuration} */
module.exports = {
plugins: [
new ModuleFederationPlugin({
name: "container",
filename: "container.js",
library: { type: "commonjs-module" },
exposes: ["./module"]
})
]
};

View File

@ -0,0 +1,7 @@
import c1 from "./c1";
it("should allow to import an conditionally unneeded chunk", async () => {
const c2 = await c1();
const c1_ = await c2.default();
expect(c1_.value).toBe(1);
});

View File

@ -0,0 +1,7 @@
import c2 from "./c2";
it("should allow to import an conditionally unneeded chunk", async () => {
const c1 = await c2();
const c2_ = await c1.default();
expect(c2_.value).toBe(2);
});

View File

@ -0,0 +1,2 @@
export default () => import("./c2");
export const value = 1;

View File

@ -0,0 +1,2 @@
export default () => import("./c1");
export const value = 2;

View File

@ -0,0 +1,15 @@
/** @type {import("../../../../").Configuration} */
module.exports = {
entry: {
bundle0: "./a",
bundle1: "./b"
},
optimization: {
flagIncludedChunks: false,
chunkIds: "named"
},
output: {
filename: "[name].js",
chunkFilename: "[id].[chunkhash].js"
}
};

View File

@ -1,6 +1,5 @@
var webpack = require("../../../../");
/** @type {import("../../../../").Configuration[]} */
/** @type {import("../../../../").Configuration[]} */
module.exports = [
{
name: "hash with length in publicPath",

218
types.d.ts vendored
View File

@ -364,6 +364,15 @@ declare interface BannerPluginOptions {
*/
test?: Rules;
}
declare interface BaseResolveRequest {
path: DevTool;
descriptionFilePath?: string;
descriptionFileRoot?: string;
descriptionFileData?: any;
relativePath?: string;
ignoreSymlinks?: boolean;
fullySpecified?: boolean;
}
declare abstract class BasicEvaluatedExpression {
type: number;
range: [number, number];
@ -5433,6 +5442,14 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
fs: InputFileSystem;
parserCache: Map<string, WeakMap<any, any>>;
generatorCache: Map<string, WeakMap<any, Generator>>;
resolveResource(
contextInfo?: any,
context?: any,
unresolvedResource?: any,
resolver?: any,
resolveContext?: any,
callback?: any
): void;
resolveRequestArray(
contextInfo?: any,
context?: any,
@ -6340,6 +6357,7 @@ declare interface ParsedIdentifier {
directory: boolean;
module: boolean;
file: boolean;
internal: boolean;
}
declare class Parser {
constructor();
@ -6802,6 +6820,22 @@ declare abstract class RequestShortener {
contextify: (arg0: string) => string;
shorten(request: string): string;
}
type ResolveAlias =
| {
/**
* New request.
*/
alias: string | false | string[];
/**
* Request to be redirected.
*/
name: string;
/**
* Redirect only exact matching request.
*/
onlyModule?: boolean;
}[]
| { [index: string]: string | false | string[] };
declare interface ResolveBuildDependenciesResult {
/**
* list of files
@ -6899,6 +6933,20 @@ declare interface ResolveOptionsTypes {
*/
onlyModule?: boolean;
}[];
fallback: {
/**
* New request.
*/
alias: string | false | string[];
/**
* Request to be redirected.
*/
name: string;
/**
* Redirect only exact matching request.
*/
onlyModule?: boolean;
}[];
aliasFields: Set<LibraryExport>;
cachePredicate: (arg0: ResolveRequest) => boolean;
cacheWithContext: boolean;
@ -6910,6 +6958,7 @@ declare interface ResolveOptionsTypes {
descriptionFiles: string[];
enforceExtension: boolean;
exportsFields: Set<LibraryExport>;
importsFields: Set<LibraryExport>;
extensions: Set<string>;
fileSystem: FileSystem;
unsafeCache: any;
@ -6936,22 +6985,7 @@ declare interface ResolveOptionsWebpackOptions {
/**
* Redirect module requests.
*/
alias?:
| {
/**
* New request.
*/
alias: string | false | string[];
/**
* Request to be redirected.
*/
name: string;
/**
* Redirect only exact matching request.
*/
onlyModule?: boolean;
}[]
| { [index: string]: string | false | string[] };
alias?: ResolveAlias;
/**
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
@ -7003,6 +7037,11 @@ declare interface ResolveOptionsWebpackOptions {
*/
extensions?: string[];
/**
* Redirect module requests when normal resolving fails.
*/
fallback?: ResolveAlias;
/**
* Filesystem for the resolver.
*/
@ -7013,6 +7052,11 @@ declare interface ResolveOptionsWebpackOptions {
*/
fullySpecified?: boolean;
/**
* Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).
*/
importsFields?: string[];
/**
* Field names from the description file (package.json) which are used to find the default entry point.
*/
@ -7075,20 +7119,7 @@ declare interface ResolvePluginInstance {
*/
apply: (resolver?: any) => void;
}
declare interface ResolveRequest {
path: DevTool;
request?: string;
query?: string;
fragment?: string;
directory?: boolean;
module?: boolean;
descriptionFilePath?: string;
descriptionFileRoot?: string;
descriptionFileData?: any;
relativePath?: string;
ignoreSymlinks?: boolean;
fullySpecified?: boolean;
}
type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
declare abstract class Resolver {
fileSystem: FileSystem;
options: ResolveOptionsTypes;
@ -7134,6 +7165,7 @@ declare abstract class Resolver {
): any;
parse(identifier: string): ParsedIdentifier;
isModule(path?: any): boolean;
isPrivate(path?: any): boolean;
isDirectory(path: string): boolean;
join(path?: any, request?: any): string;
normalize(path?: any): string;
@ -7151,22 +7183,7 @@ declare abstract class ResolverFactory {
/**
* Redirect module requests.
*/
alias?:
| {
/**
* New request.
*/
alias: string | false | string[];
/**
* Request to be redirected.
*/
name: string;
/**
* Redirect only exact matching request.
*/
onlyModule?: boolean;
}[]
| { [index: string]: string | false | string[] };
alias?: ResolveAlias;
/**
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
*/
@ -7207,6 +7224,10 @@ declare abstract class ResolverFactory {
* Extensions added to the request when trying to find the file.
*/
extensions?: string[];
/**
* Redirect module requests when normal resolving fails.
*/
fallback?: ResolveAlias;
/**
* Filesystem for the resolver.
*/
@ -7215,6 +7236,10 @@ declare abstract class ResolverFactory {
* Treats the request specified by the user as fully specified, meaning no extensions are added and the mainFiles in directories are not resolved (This doesn't affect requests from mainFields, aliasFields or aliases).
*/
fullySpecified?: boolean;
/**
* Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).
*/
importsFields?: string[];
/**
* Field names from the description file (package.json) which are used to find the default entry point.
*/
@ -7270,22 +7295,7 @@ declare abstract class ResolverFactory {
/**
* Redirect module requests.
*/
alias?:
| {
/**
* New request.
*/
alias: string | false | string[];
/**
* Request to be redirected.
*/
name: string;
/**
* Redirect only exact matching request.
*/
onlyModule?: boolean;
}[]
| { [index: string]: string | false | string[] };
alias?: ResolveAlias;
/**
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
*/
@ -7326,6 +7336,10 @@ declare abstract class ResolverFactory {
* Extensions added to the request when trying to find the file.
*/
extensions?: string[];
/**
* Redirect module requests when normal resolving fails.
*/
fallback?: ResolveAlias;
/**
* Filesystem for the resolver.
*/
@ -7334,6 +7348,10 @@ declare abstract class ResolverFactory {
* Treats the request specified by the user as fully specified, meaning no extensions are added and the mainFiles in directories are not resolved (This doesn't affect requests from mainFields, aliasFields or aliases).
*/
fullySpecified?: boolean;
/**
* Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).
*/
importsFields?: string[];
/**
* Field names from the description file (package.json) which are used to find the default entry point.
*/
@ -7389,22 +7407,7 @@ declare abstract class ResolverFactory {
/**
* Redirect module requests.
*/
alias?:
| {
/**
* New request.
*/
alias: string | false | string[];
/**
* Request to be redirected.
*/
name: string;
/**
* Redirect only exact matching request.
*/
onlyModule?: boolean;
}[]
| { [index: string]: string | false | string[] };
alias?: ResolveAlias;
/**
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
*/
@ -7445,6 +7448,10 @@ declare abstract class ResolverFactory {
* Extensions added to the request when trying to find the file.
*/
extensions?: string[];
/**
* Redirect module requests when normal resolving fails.
*/
fallback?: ResolveAlias;
/**
* Filesystem for the resolver.
*/
@ -7453,6 +7460,10 @@ declare abstract class ResolverFactory {
* Treats the request specified by the user as fully specified, meaning no extensions are added and the mainFiles in directories are not resolved (This doesn't affect requests from mainFields, aliasFields or aliases).
*/
fullySpecified?: boolean;
/**
* Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).
*/
importsFields?: string[];
/**
* Field names from the description file (package.json) which are used to find the default entry point.
*/
@ -9098,6 +9109,26 @@ declare interface UserResolveOptions {
onlyModule?: boolean;
}[];
/**
* A list of module alias configurations or an object which maps key to value, applied only after modules option
*/
fallback?:
| { [index: string]: string | false | string[] }
| {
/**
* New request.
*/
alias: string | false | string[];
/**
* Request to be redirected.
*/
name: string;
/**
* Redirect only exact matching request.
*/
onlyModule?: boolean;
}[];
/**
* A list of alias fields in description files
*/
@ -9133,6 +9164,11 @@ declare interface UserResolveOptions {
*/
exportsFields?: LibraryExport[];
/**
* A list of imports fields in description files
*/
importsFields?: LibraryExport[];
/**
* A list of extensions which should be tried for files
*/
@ -9581,22 +9617,7 @@ declare interface WithOptions {
/**
* Redirect module requests.
*/
alias?:
| {
/**
* New request.
*/
alias: string | false | string[];
/**
* Request to be redirected.
*/
name: string;
/**
* Redirect only exact matching request.
*/
onlyModule?: boolean;
}[]
| { [index: string]: string | false | string[] };
alias?: ResolveAlias;
/**
* Fields in the description file (usually package.json) which are used to redirect requests inside the module.
*/
@ -9637,6 +9658,10 @@ declare interface WithOptions {
* Extensions added to the request when trying to find the file.
*/
extensions?: string[];
/**
* Redirect module requests when normal resolving fails.
*/
fallback?: ResolveAlias;
/**
* Filesystem for the resolver.
*/
@ -9645,6 +9670,10 @@ declare interface WithOptions {
* Treats the request specified by the user as fully specified, meaning no extensions are added and the mainFiles in directories are not resolved (This doesn't affect requests from mainFields, aliasFields or aliases).
*/
fullySpecified?: boolean;
/**
* Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).
*/
importsFields?: string[];
/**
* Field names from the description file (package.json) which are used to find the default entry point.
*/
@ -9822,6 +9851,7 @@ declare namespace exports {
export let global: string;
export let shareScopeMap: string;
export let initializeSharing: string;
export let currentRemoteGetScope: string;
export let getUpdateManifestFilename: string;
export let hmrDownloadManifest: string;
export let hmrDownloadUpdateHandlers: string;

View File

@ -725,9 +725,9 @@
integrity sha512-kVrqXhbclHNHGu9ztnAwSncIgJv/FaxmzXJvGXNdcCpV1b8u1/Mi6z6m0vwy0LzKeXFTPLH0NzwmoJ3fNCIq0g==
"@types/node@^13.13.15":
version "13.13.19"
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.19.tgz#f4165496e66e3da37b9e136887db446795e00c5b"
integrity sha512-IVsULCpTdafcHhBDLYEPnV5l15xV0q065zvOHC1ZmzFYaBCMzku078eXnazoSG8907vZjRgEN/EQjku7GwwFyQ==
version "13.13.21"
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.21.tgz#e48d3c2e266253405cf404c8654d1bcf0d333e5c"
integrity sha512-tlFWakSzBITITJSxHV4hg4KvrhR/7h3xbJdSFbYJBVzKubrASbnnIFuSgolUh7qKGo/ZeJPKUfbZ0WS6Jp14DQ==
"@types/normalize-package-data@^2.4.0":
version "2.4.0"
@ -2304,14 +2304,6 @@ end-of-stream@^1.1.0:
dependencies:
once "^1.4.0"
enhanced-resolve@5.0.0-beta.10:
version "5.0.0-beta.10"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.0.0-beta.10.tgz#3907c034f8e59446dfa5a89a1fd73db29aa0f246"
integrity sha512-vEyxvHv3f8xl7i7QmTQ6BqKY32acSPQ4dTZo8WRMtcqTDYH9YyXnDxqXsQqBLvdRHUiwl9nVivESiM1RcrxbKQ==
dependencies:
graceful-fs "^4.2.0"
tapable "^2.0.0-beta.10"
enhanced-resolve@^4.0.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz#3b806f3bfafc1ec7de69551ef93cca46c1704126"
@ -2321,6 +2313,14 @@ enhanced-resolve@^4.0.0:
memory-fs "^0.5.0"
tapable "^1.0.0"
enhanced-resolve@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.0.0.tgz#4737e6ebd4f2fd13fe23f4cec9d02146afc2c527"
integrity sha512-6F037vvK16tgLlRgUx6ZEZISMysNvnnk09SILFrx3bNa1UsSLpIXFzWOmtiDxf1ISPAG6/wHBI61PEkeuTLVNA==
dependencies:
graceful-fs "^4.2.4"
tapable "^2.0.0"
enquirer@^2.3.6:
version "2.3.6"
resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d"
@ -4278,9 +4278,9 @@ lines-and-columns@^1.1.6:
integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=
lint-staged@^10.2.11:
version "10.3.0"
resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.3.0.tgz#388c3d440590c45c339e7163f669ea69ae90b1e0"
integrity sha512-an3VgjHqmJk0TORB/sdQl0CTkRg4E5ybYCXTTCSJ5h9jFwZbcgKIx5oVma5e7wp/uKt17s1QYFmYqT9MGVosGw==
version "10.4.0"
resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.4.0.tgz#d18628f737328e0bbbf87d183f4020930e9a984e"
integrity sha512-uaiX4U5yERUSiIEQc329vhCTDDwUcSvKdRLsNomkYLRzijk3v8V9GWm2Nz0RMVB87VcuzLvtgy6OsjoH++QHIg==
dependencies:
chalk "^4.1.0"
cli-truncate "^2.1.0"
@ -5175,9 +5175,9 @@ prettier@^1.19.1:
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
prettier@^2.0.5:
version "2.1.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.1.tgz#d9485dd5e499daa6cb547023b87a6cf51bee37d6"
integrity sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw==
version "2.1.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5"
integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==
pretty-format@^25.2.1, pretty-format@^25.5.0:
version "25.5.0"
@ -5769,10 +5769,10 @@ semver@^7.3.2:
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938"
integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==
serialize-javascript@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa"
integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==
serialize-javascript@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4"
integrity sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==
dependencies:
randombytes "^2.1.0"
@ -6220,10 +6220,10 @@ tapable@^1.0.0:
resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2"
integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==
tapable@^2.0.0-beta.10, tapable@^2.0.0-beta.11:
version "2.0.0-beta.11"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.0.0-beta.11.tgz#5a6bd5e0353fad4da9e94942206bb596639e8cf7"
integrity sha512-cAhRzCvMdyJsxmdrSXG8/SUlJG4WJUxD/csuYAybUFjKVt74Y6pTyZ/I1ZK+enmCkWZN0JWxh14G69temaGSiA==
tapable@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.0.0.tgz#a49c3d6a8a2bb606e7db372b82904c970d537a08"
integrity sha512-bjzn0C0RWoffnNdTzNi7rNDhs1Zlwk2tRXgk8EiHKAOX1Mag3d6T0Y5zNa7l9CJ+EoUne/0UHdwS8tMbkh9zDg==
tar@^6.0.2:
version "6.0.2"
@ -6262,18 +6262,18 @@ terminal-link@^2.0.0:
supports-hyperlinks "^2.0.0"
terser-webpack-plugin@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-4.1.0.tgz#6e9d6ae4e1a900d88ddce8da6a47507ea61f44bc"
integrity sha512-0ZWDPIP8BtEDZdChbufcXUigOYk6dOX/P/X0hWxqDDcVAQLb8Yy/0FAaemSfax3PAA67+DJR778oz8qVbmy4hA==
version "4.2.1"
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-4.2.1.tgz#44b88ef4d7443129fb136a68b5ec3e80d63ec471"
integrity sha512-D0IZQNl1ZN/JivFNDFzOeU2Bk2LdQQESHJhKTHsodpUmISkaeRwVFk7gzHzX4OuQwanDGelOxIEsBt1SZ+s6nA==
dependencies:
cacache "^15.0.5"
find-cache-dir "^3.3.1"
jest-worker "^26.3.0"
p-limit "^3.0.2"
schema-utils "^2.6.6"
serialize-javascript "^4.0.0"
schema-utils "^2.7.1"
serialize-javascript "^5.0.1"
source-map "^0.6.1"
terser "^5.0.0"
terser "^5.3.1"
webpack-sources "^1.4.3"
terser@^4.8.0:
@ -6285,10 +6285,10 @@ terser@^4.8.0:
source-map "~0.6.1"
source-map-support "~0.5.12"
terser@^5.0.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/terser/-/terser-5.2.0.tgz#e547d0b20926b321d3e524bf9e5bc1b10ba2f360"
integrity sha512-nZ9TWhBznZdlww3borgJyfQDrxzpgd0RlRNoxR63tMVry01lIH/zKQDTTiaWRMGowydfvSHMgyiGyn6A9PSkCQ==
terser@^5.3.1:
version "5.3.1"
resolved "https://registry.yarnpkg.com/terser/-/terser-5.3.1.tgz#f50fe20ab48b15234fe9bdd86b10148ad5fca787"
integrity sha512-yD80f4hdwCWTH5mojzxe1q8bN1oJbsK/vfJGLcPZM/fl+/jItIVNKhFIHqqR71OipFWMLgj3Kc+GIp6CeIqfnA==
dependencies:
commander "^2.20.0"
source-map "~0.6.1"
@ -6706,10 +6706,10 @@ wast-loader@^1.9.0:
dependencies:
wabt "1.0.0-nightly.20180421"
watchpack@2.0.0-beta.15:
version "2.0.0-beta.15"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.0.0-beta.15.tgz#0e69c8e5d680c7b4c181db3f70e500ca84cef794"
integrity sha512-zyhhC7vEajo5fZEUxlhVpC1uLAOs088zy8RwzcMp8YucTBirNCNmTFQWVeoKxKNNqEfYUBQdVzW3wfItcc/eUQ==
watchpack@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.0.0.tgz#b12248f32f0fd4799b7be0802ad1f6573a45955c"
integrity sha512-xSdCxxYZWNk3VK13bZRYhsQpfa8Vg63zXG+3pyU8ouqSLRCv4IGXIp9Kr226q6GBkGRlZrST2wwKtjfKz2m7Cg==
dependencies:
glob-to-regexp "^0.4.1"
graceful-fs "^4.1.2"
@ -6724,14 +6724,6 @@ webidl-conversions@^4.0.2:
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==
webpack-sources@2.0.0-beta.10:
version "2.0.0-beta.10"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-2.0.0-beta.10.tgz#f603355c5518141976601bfd620a3a5a01ac7b5d"
integrity sha512-HxeYa9Q6nMk3MtSbi5mKUUV+gOxYlGQwujKbeK0JQ+SmLSMgC4cQkZ+xpsWvsUtTvskDwpKvuVLpE9eW7vn0IQ==
dependencies:
source-list-map "^2.0.1"
source-map "^0.6.1"
webpack-sources@^1.1.0, webpack-sources@^1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933"
@ -6740,6 +6732,14 @@ webpack-sources@^1.1.0, webpack-sources@^1.4.3:
source-list-map "^2.0.0"
source-map "~0.6.1"
webpack-sources@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-2.0.0.tgz#602d4bc7ff2e630ceb753a09ef49f260fa4ae7f0"
integrity sha512-CpCkDjEKa5vYVRDFDRABBkBomz+82lz9bpXViN1LBc8L/WDXvSyELKcBvBnTeDEiRfMJCGAFG9+04406PLSsIA==
dependencies:
source-list-map "^2.0.1"
source-map "^0.6.1"
whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0"