Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
54dbeb30
Unverified
Commit
54dbeb30
authored
Feb 16, 2022
by
Tobias Koppers
Committed by
GitHub
Feb 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update webpack (#34444)
https://github.com/webpack/webpack/releases/tag/v5.69.0
parent
9b38ffe5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
712 additions
and
337 deletions
+712
-337
bundle5.js
packages/next/compiled/webpack/bundle5.js
+692
-317
package.json
packages/next/package.json
+1
-1
yarn.lock
yarn.lock
+19
-19
No files found.
packages/next/compiled/webpack/bundle5.js
View file @
54dbeb30
...
@@ -19047,6 +19047,7 @@ const compareModuleIterables = compareIterables(compareModulesByIdentifier);
...
@@ -19047,6 +19047,7 @@ const compareModuleIterables = compareIterables(compareModulesByIdentifier);
/** @typedef {(c: Chunk, chunkGraph: ChunkGraph) => boolean} ChunkFilterPredicate */
/** @typedef {(c: Chunk, chunkGraph: ChunkGraph) => boolean} ChunkFilterPredicate */
/** @typedef {(m: Module) => boolean} ModuleFilterPredicate */
/** @typedef {(m: Module) => boolean} ModuleFilterPredicate */
/** @typedef {[Module, Entrypoint | undefined]} EntryModuleWithChunkGroup */
/**
/**
* @typedef {Object} ChunkSizeOptions
* @typedef {Object} ChunkSizeOptions
...
@@ -20181,8 +20182,6 @@ class ChunkGraph {
...
@@ -20181,8 +20182,6 @@ class ChunkGraph {
return cgc.dependentHashModules;
return cgc.dependentHashModules;
}
}
/** @typedef {[Module, Entrypoint | undefined]} EntryModuleWithChunkGroup */
/**
/**
* @param {Chunk} chunk the chunk
* @param {Chunk} chunk the chunk
* @returns {Iterable<EntryModuleWithChunkGroup>} iterable of modules (do not modify)
* @returns {Iterable<EntryModuleWithChunkGroup>} iterable of modules (do not modify)
...
@@ -22479,6 +22478,7 @@ const { isSourceEqual } = __webpack_require__(41245);
...
@@ -22479,6 +22478,7 @@ const { isSourceEqual } = __webpack_require__(41245);
/**
/**
* @typedef {Object} ChunkHashContext
* @typedef {Object} ChunkHashContext
* @property {CodeGenerationResults} codeGenerationResults results of code generation
* @property {RuntimeTemplate} runtimeTemplate the runtime template
* @property {RuntimeTemplate} runtimeTemplate the runtime template
* @property {ModuleGraph} moduleGraph the module graph
* @property {ModuleGraph} moduleGraph the module graph
* @property {ChunkGraph} chunkGraph the chunk graph
* @property {ChunkGraph} chunkGraph the chunk graph
...
@@ -26434,6 +26434,7 @@ This prevents using hashes of each other and should be avoided.`);
...
@@ -26434,6 +26434,7 @@ This prevents using hashes of each other and should be avoided.`);
chunk.updateHash(chunkHash, chunkGraph);
chunk.updateHash(chunkHash, chunkGraph);
this.hooks.chunkHash.call(chunk, chunkHash, {
this.hooks.chunkHash.call(chunk, chunkHash, {
chunkGraph,
chunkGraph,
codeGenerationResults: this.codeGenerationResults,
moduleGraph: this.moduleGraph,
moduleGraph: this.moduleGraph,
runtimeTemplate: this.runtimeTemplate
runtimeTemplate: this.runtimeTemplate
});
});
...
@@ -27267,7 +27268,7 @@ This prevents using hashes of each other and should be avoided.`);
...
@@ -27267,7 +27268,7 @@ This prevents using hashes of each other and should be avoided.`);
strictModuleErrorHandling,
strictModuleErrorHandling,
strictModuleExceptionHandling
strictModuleExceptionHandling
} = this.outputOptions;
} = this.outputOptions;
const __nested_webpack_require_152
290
__ = id => {
const __nested_webpack_require_152
432
__ = id => {
const cached = moduleCache[id];
const cached = moduleCache[id];
if (cached !== undefined) {
if (cached !== undefined) {
if (cached.error) throw cached.error;
if (cached.error) throw cached.error;
...
@@ -27276,20 +27277,20 @@ This prevents using hashes of each other and should be avoided.`);
...
@@ -27276,20 +27277,20 @@ This prevents using hashes of each other and should be avoided.`);
const moduleArgument = moduleArgumentsById.get(id);
const moduleArgument = moduleArgumentsById.get(id);
return __webpack_require_module__(moduleArgument, id);
return __webpack_require_module__(moduleArgument, id);
};
};
const interceptModuleExecution = (__nested_webpack_require_152
290
__[
const interceptModuleExecution = (__nested_webpack_require_152
432
__[
RuntimeGlobals.interceptModuleExecution.replace(
RuntimeGlobals.interceptModuleExecution.replace(
"__webpack_require__.",
"__webpack_require__.",
""
""
)
)
] = []);
] = []);
const moduleCache = (__nested_webpack_require_152
290
__[
const moduleCache = (__nested_webpack_require_152
432
__[
RuntimeGlobals.moduleCache.replace(
RuntimeGlobals.moduleCache.replace(
"__webpack_require__.",
"__webpack_require__.",
""
""
)
)
] = {});
] = {});
context.__webpack_require__ = __nested_webpack_require_152
290
__;
context.__webpack_require__ = __nested_webpack_require_152
432
__;
/**
/**
* @param {ExecuteModuleArgument} moduleArgument the module argument
* @param {ExecuteModuleArgument} moduleArgument the module argument
...
@@ -27305,7 +27306,7 @@ This prevents using hashes of each other and should be avoided.`);
...
@@ -27305,7 +27306,7 @@ This prevents using hashes of each other and should be avoided.`);
loaded: false,
loaded: false,
error: undefined
error: undefined
},
},
require: __nested_webpack_require_152
290
__
require: __nested_webpack_require_152
432
__
};
};
interceptModuleExecution.forEach(handler =>
interceptModuleExecution.forEach(handler =>
handler(execOptions)
handler(execOptions)
...
@@ -27345,7 +27346,7 @@ This prevents using hashes of each other and should be avoided.`);
...
@@ -27345,7 +27346,7 @@ This prevents using hashes of each other and should be avoided.`);
moduleArgumentsMap.get(runtimeModule)
moduleArgumentsMap.get(runtimeModule)
);
);
}
}
exports = __nested_webpack_require_152
290
__(module.identifier());
exports = __nested_webpack_require_152
432
__(module.identifier());
} catch (e) {
} catch (e) {
const err = new WebpackError(
const err = new WebpackError(
`Execution of module code from module graph (${module.readableIdentifier(
`Execution of module code from module graph (${module.readableIdentifier(
...
@@ -29715,7 +29716,7 @@ const makeSerializable = __webpack_require__(33032);
...
@@ -29715,7 +29716,7 @@ const makeSerializable = __webpack_require__(33032);
/**
/**
* @typedef {Object} ContextModuleOptionsExtras
* @typedef {Object} ContextModuleOptionsExtras
* @property {string} resource
* @property {string
|string[]
} resource
* @property {string=} resourceQuery
* @property {string=} resourceQuery
* @property {string=} resourceFragment
* @property {string=} resourceFragment
* @property {TODO} resolveOptions
* @property {TODO} resolveOptions
...
@@ -29746,23 +29747,36 @@ class ContextModule extends Module {
...
@@ -29746,23 +29747,36 @@ class ContextModule extends Module {
* @param {ContextModuleOptions} options options object
* @param {ContextModuleOptions} options options object
*/
*/
constructor(resolveDependencies, options) {
constructor(resolveDependencies, options) {
const parsed = parseResource(options ? options.resource : "");
if (!options || typeof options.resource === "string") {
const resource = parsed.path;
const parsed = parseResource(
const resourceQuery = (options && options.resourceQuery) || parsed.query;
options ? /** @type {string} */ (options.resource) : ""
const resourceFragment =
);
(options && options.resourceFragment) || parsed.fragment;
const resource = parsed.path;
const resourceQuery = (options && options.resourceQuery) || parsed.query;
super("javascript/dynamic", resource);
const resourceFragment =
(options && options.resourceFragment) || parsed.fragment;
super("javascript/dynamic", resource);
/** @type {ContextModuleOptions} */
this.options = {
...options,
resource,
resourceQuery,
resourceFragment
};
} else {
super("javascript/dynamic");
/** @type {ContextModuleOptions} */
this.options = {
...options,
resource: options.resource,
resourceQuery: options.resourceQuery || "",
resourceFragment: options.resourceFragment || ""
};
}
// Info from Factory
// Info from Factory
this.resolveDependencies = resolveDependencies;
this.resolveDependencies = resolveDependencies;
/** @type {ContextModuleOptions} */
this.options = {
...options,
resource,
resourceQuery,
resourceFragment
};
if (options && options.resolveOptions !== undefined) {
if (options && options.resolveOptions !== undefined) {
this.resolveOptions = options.resolveOptions;
this.resolveOptions = options.resolveOptions;
}
}
...
@@ -29809,7 +29823,11 @@ class ContextModule extends Module {
...
@@ -29809,7 +29823,11 @@ class ContextModule extends Module {
}
}
_createIdentifier() {
_createIdentifier() {
let identifier = this.context;
let identifier =
this.context ||
(typeof this.options.resource === "string"
? this.options.resource
: this.options.resource.join("|"));
if (this.options.resourceQuery) {
if (this.options.resourceQuery) {
identifier += `|${this.options.resourceQuery}`;
identifier += `|${this.options.resourceQuery}`;
}
}
...
@@ -29874,7 +29892,16 @@ class ContextModule extends Module {
...
@@ -29874,7 +29892,16 @@ class ContextModule extends Module {
* @returns {string} a user readable identifier of the module
* @returns {string} a user readable identifier of the module
*/
*/
readableIdentifier(requestShortener) {
readableIdentifier(requestShortener) {
let identifier = requestShortener.shorten(this.context) + "/";
let identifier;
if (this.context) {
identifier = requestShortener.shorten(this.context) + "/";
} else if (typeof this.options.resource === "string") {
identifier = requestShortener.shorten(this.options.resource) + "/";
} else {
identifier = this.options.resource
.map(r => requestShortener.shorten(r) + "/")
.join(" ");
}
if (this.options.resourceQuery) {
if (this.options.resourceQuery) {
identifier += ` ${this.options.resourceQuery}`;
identifier += ` ${this.options.resourceQuery}`;
}
}
...
@@ -29924,11 +29951,30 @@ class ContextModule extends Module {
...
@@ -29924,11 +29951,30 @@ class ContextModule extends Module {
* @returns {string | null} an identifier for library inclusion
* @returns {string | null} an identifier for library inclusion
*/
*/
libIdent(options) {
libIdent(options) {
let identifier = contextify(
let identifier;
options.context,
this.context,
if (this.context) {
options.associatedObjectForCache
identifier = contextify(
);
options.context,
this.context,
options.associatedObjectForCache
);
} else if (typeof this.options.resource === "string") {
identifier = contextify(
options.context,
this.options.resource,
options.associatedObjectForCache
);
} else {
const arr = [];
for (const res of this.options.resource) {
arr.push(
contextify(options.context, res, options.associatedObjectForCache)
);
}
identifier = arr.join(" ");
}
if (this.layer) identifier = `(${this.layer})/${identifier}`;
if (this.layer) identifier = `(${this.layer})/${identifier}`;
if (this.options.mode) {
if (this.options.mode) {
identifier += ` ${this.options.mode}`;
identifier += ` ${this.options.mode}`;
...
@@ -30096,7 +30142,11 @@ class ContextModule extends Module {
...
@@ -30096,7 +30142,11 @@ class ContextModule extends Module {
compilation.fileSystemInfo.createSnapshot(
compilation.fileSystemInfo.createSnapshot(
startTime,
startTime,
null,
null,
[this.context],
this.context
? [this.context]
: typeof this.options.resource === "string"
? [this.options.resource]
: this.options.resource,
null,
null,
SNAPSHOT_OPTIONS,
SNAPSHOT_OPTIONS,
(err, snapshot) => {
(err, snapshot) => {
...
@@ -30120,7 +30170,13 @@ class ContextModule extends Module {
...
@@ -30120,7 +30170,13 @@ class ContextModule extends Module {
missingDependencies,
missingDependencies,
buildDependencies
buildDependencies
) {
) {
contextDependencies.add(this.context);
if (this.context) {
contextDependencies.add(this.context);
} else if (typeof this.options.resource === "string") {
contextDependencies.add(this.options.resource);
} else {
for (const res of this.options.resource) contextDependencies.add(res);
}
}
}
/**
/**
...
@@ -30912,6 +30968,9 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
...
@@ -30912,6 +30968,9 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
asyncLib.parallel(
asyncLib.parallel(
[
[
callback => {
callback => {
const results = [];
const yield_ = obj => results.push(obj);
contextResolver.resolve(
contextResolver.resolve(
{},
{},
context,
context,
...
@@ -30919,11 +30978,12 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
...
@@ -30919,11 +30978,12 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
{
{
fileDependencies,
fileDependencies,
missingDependencies,
missingDependencies,
contextDependencies
contextDependencies,
yield: yield_
},
},
(err, result)
=> {
err
=> {
if (err) return callback(err);
if (err) return callback(err);
callback(null, result);
callback(null, result
s
);
}
}
);
);
},
},
...
@@ -30958,15 +31018,20 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
...
@@ -30958,15 +31018,20 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
contextDependencies
contextDependencies
});
});
}
}
const [contextResult, loaderResult] = result;
this.hooks.afterResolve.callAsync(
this.hooks.afterResolve.callAsync(
{
{
addon:
addon:
loadersPrefix +
loadersPrefix +
result[1].join("!") +
loaderResult.join("!") +
(result[1].length > 0 ? "!" : ""),
(loaderResult.length > 0 ? "!" : ""),
resource: result[0],
resource:
contextResult.length > 1
? contextResult.map(r => r.path)
: contextResult[0].path,
resolveDependencies: this.resolveDependencies.bind(this),
resolveDependencies: this.resolveDependencies.bind(this),
resourceQuery: contextResult[0].query,
resourceFragment: contextResult[0].fragment,
...beforeResolveResult
...beforeResolveResult
},
},
(err, result) => {
(err, result) => {
...
@@ -31023,26 +31088,28 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
...
@@ -31023,26 +31088,28 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
} = options;
} = options;
if (!regExp || !resource) return callback(null, []);
if (!regExp || !resource) return callback(null, []);
const addDirectoryChecked = (directory, visited, callback) => {
let severalContexts = false;
const addDirectoryChecked = (ctx, directory, visited, callback) => {
fs.realpath(directory, (err, realPath) => {
fs.realpath(directory, (err, realPath) => {
if (err) return callback(err);
if (err) return callback(err);
if (visited.has(realPath)) return callback(null, []);
if (visited.has(realPath)) return callback(null, []);
let recursionStack;
let recursionStack;
addDirectory(
addDirectory(
ctx,
directory,
directory,
(dir, callback) => {
(
_,
dir, callback) => {
if (recursionStack === undefined) {
if (recursionStack === undefined) {
recursionStack = new Set(visited);
recursionStack = new Set(visited);
recursionStack.add(realPath);
recursionStack.add(realPath);
}
}
addDirectoryChecked(dir, recursionStack, callback);
addDirectoryChecked(
ctx,
dir, recursionStack, callback);
},
},
callback
callback
);
);
});
});
};
};
const addDirectory = (directory, addSubDirectory, callback) => {
const addDirectory = (
ctx,
directory, addSubDirectory, callback) => {
fs.readdir(directory, (err, files) => {
fs.readdir(directory, (err, files) => {
if (err) return callback(err);
if (err) return callback(err);
const processedFiles = cmf.hooks.contextModuleFiles.call(
const processedFiles = cmf.hooks.contextModuleFiles.call(
...
@@ -31069,16 +31136,15 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
...
@@ -31069,16 +31136,15 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
if (stat.isDirectory()) {
if (stat.isDirectory()) {
if (!recursive) return callback();
if (!recursive) return callback();
addSubDirectory(subResource, callback);
addSubDirectory(
ctx,
subResource, callback);
} else if (
} else if (
stat.isFile() &&
stat.isFile() &&
(!include || subResource.match(include))
(!include || subResource.match(include))
) {
) {
const obj = {
const obj = {
context:
resource
,
context:
ctx
,
request:
request:
"." +
"." + subResource.substr(ctx.length).replace(/\\/g, "/")
subResource.substr(resource.length).replace(/\\/g, "/")
};
};
this.hooks.alternativeRequests.callAsync(
this.hooks.alternativeRequests.callAsync(
...
@@ -31089,8 +31155,11 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
...
@@ -31089,8 +31155,11 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
alternatives = alternatives
alternatives = alternatives
.filter(obj => regExp.test(obj.request))
.filter(obj => regExp.test(obj.request))
.map(obj => {
.map(obj => {
const request = severalContexts
? join(fs, obj.context, obj.request)
: obj.request;
const dep = new ContextElementDependency(
const dep = new ContextElementDependency(
obj.
request + resourceQuery + resourceFragment,
request + resourceQuery + resourceFragment,
obj.request,
obj.request,
typePrefix,
typePrefix,
category,
category,
...
@@ -31127,12 +31196,38 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
...
@@ -31127,12 +31196,38 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
});
});
};
};
if (typeof fs.realpath === "function") {
const addSubDirectory = (ctx, dir, callback) =>
addDirectoryChecked(resource, new Set(), callback);
addDirectory(ctx, dir, addSubDirectory, callback);
const visitResource = (resource, callback) => {
if (typeof fs.realpath === "function") {
addDirectoryChecked(resource, resource, new Set(), callback);
} else {
addDirectory(resource, resource, addSubDirectory, callback);
}
};
if (typeof resource === "string") {
visitResource(resource, callback);
} else {
} else {
const addSubDirectory = (dir, callback) =>
severalContexts = true;
addDirectory(dir, addSubDirectory, callback);
asyncLib.map(resource, visitResource, (err, result) => {
addDirectory(resource, addSubDirectory, callback);
if (err) return callback(err);
// result dependencies should have unique userRequest
// ordered by resolve result
const temp = new Set();
const res = [];
for (let i = 0; i < result.length; i++) {
const inner = result[i];
for (const el of inner) {
if (temp.has(el.userRequest)) continue;
res.push(el);
temp.add(el.userRequest);
}
}
callback(null, res);
});
}
}
}
}
};
};
...
@@ -34588,15 +34683,15 @@ class ExportsInfo {
...
@@ -34588,15 +34683,15 @@ class ExportsInfo {
}
}
}
}
for (const exportInfo of this._exports.values()) {
for (const exportInfo of this._exports.values()) {
if (!canMangle && exportInfo.canMangleProvide !== false) {
exportInfo.canMangleProvide = false;
changed = true;
}
if (excludeExports && excludeExports.has(exportInfo.name)) continue;
if (excludeExports && excludeExports.has(exportInfo.name)) continue;
if (exportInfo.provided !== true && exportInfo.provided !== null) {
if (exportInfo.provided !== true && exportInfo.provided !== null) {
exportInfo.provided = null;
exportInfo.provided = null;
changed = true;
changed = true;
}
}
if (!canMangle && exportInfo.canMangleProvide !== false) {
exportInfo.canMangleProvide = false;
changed = true;
}
if (targetKey) {
if (targetKey) {
exportInfo.setTarget(targetKey, targetModule, [exportInfo.name], -1);
exportInfo.setTarget(targetKey, targetModule, [exportInfo.name], -1);
}
}
...
@@ -49902,7 +49997,10 @@ const LazySet = __webpack_require__(38938);
...
@@ -49902,7 +49997,10 @@ const LazySet = __webpack_require__(38938);
const { getScheme } = __webpack_require__(54500);
const { getScheme } = __webpack_require__(54500);
const { cachedCleverMerge, cachedSetProperty } = __webpack_require__(60839);
const { cachedCleverMerge, cachedSetProperty } = __webpack_require__(60839);
const { join } = __webpack_require__(17139);
const { join } = __webpack_require__(17139);
const { parseResource } = __webpack_require__(82186);
const {
parseResource,
parseResourceWithoutFragment
} = __webpack_require__(82186);
/** @typedef {import("../declarations/WebpackOptions").ModuleOptionsNormalized} ModuleOptions */
/** @typedef {import("../declarations/WebpackOptions").ModuleOptionsNormalized} ModuleOptions */
/** @typedef {import("./Generator")} Generator */
/** @typedef {import("./Generator")} Generator */
...
@@ -49940,6 +50038,11 @@ const { parseResource } = __webpack_require__(82186);
...
@@ -49940,6 +50038,11 @@ const { parseResource } = __webpack_require__(82186);
/** @typedef {ResourceData & { data: Record<string, any> }} ResourceDataWithData */
/** @typedef {ResourceData & { data: Record<string, any> }} ResourceDataWithData */
/** @typedef {Object} ParsedLoaderRequest
* @property {string} loader loader
* @property {string|undefined} options options
*/
const EMPTY_RESOLVE_OPTIONS = {};
const EMPTY_RESOLVE_OPTIONS = {};
const EMPTY_PARSER_OPTIONS = {};
const EMPTY_PARSER_OPTIONS = {};
const EMPTY_GENERATOR_OPTIONS = {};
const EMPTY_GENERATOR_OPTIONS = {};
...
@@ -49971,27 +50074,6 @@ const stringifyLoadersAndResource = (loaders, resource) => {
...
@@ -49971,27 +50074,6 @@ const stringifyLoadersAndResource = (loaders, resource) => {
return str + resource;
return str + resource;
};
};
/**
* @param {string} resultString resultString
* @returns {{loader: string, options: string|undefined}} parsed loader request
*/
const identToLoaderRequest = resultString => {
const idx = resultString.indexOf("?");
if (idx >= 0) {
const loader = resultString.substr(0, idx);
const options = resultString.substr(idx + 1);
return {
loader,
options
};
} else {
return {
loader: resultString,
options: undefined
};
}
};
const needCalls = (times, callback) => {
const needCalls = (times, callback) => {
return err => {
return err => {
if (--times === 0) {
if (--times === 0) {
...
@@ -50138,6 +50220,9 @@ class NormalModuleFactory extends ModuleFactory {
...
@@ -50138,6 +50220,9 @@ class NormalModuleFactory extends ModuleFactory {
const cacheParseResource = parseResource.bindCache(
const cacheParseResource = parseResource.bindCache(
associatedObjectForCache
associatedObjectForCache
);
);
const cachedParseResourceWithoutFragment =
parseResourceWithoutFragment.bindCache(associatedObjectForCache);
this._parseResourceWithoutFragment = cachedParseResourceWithoutFragment;
this.hooks.factorize.tapAsync(
this.hooks.factorize.tapAsync(
{
{
...
@@ -50225,7 +50310,7 @@ class NormalModuleFactory extends ModuleFactory {
...
@@ -50225,7 +50310,7 @@ class NormalModuleFactory extends ModuleFactory {
let matchResourceData = undefined;
let matchResourceData = undefined;
/** @type {string} */
/** @type {string} */
let unresolvedResource;
let unresolvedResource;
/** @type {
{loader: string, options: string|undefined}
[]} */
/** @type {
ParsedLoaderRequest
[]} */
let elements;
let elements;
let noPreAutoLoaders = false;
let noPreAutoLoaders = false;
let noAutoLoaders = false;
let noAutoLoaders = false;
...
@@ -50279,7 +50364,13 @@ class NormalModuleFactory extends ModuleFactory {
...
@@ -50279,7 +50364,13 @@ class NormalModuleFactory extends ModuleFactory {
)
)
.split(/!+/);
.split(/!+/);
unresolvedResource = rawElements.pop();
unresolvedResource = rawElements.pop();
elements = rawElements.map(identToLoaderRequest);
elements = rawElements.map(el => {
const { path, query } = cachedParseResourceWithoutFragment(el);
return {
loader: path,
options: query ? query.slice(1) : undefined
};
});
scheme = getScheme(unresolvedResource);
scheme = getScheme(unresolvedResource);
} else {
} else {
unresolvedResource = requestWithoutMatchResource;
unresolvedResource = requestWithoutMatchResource;
...
@@ -50891,12 +50982,14 @@ If changing the source code is not an option there is also a resolve options cal
...
@@ -50891,12 +50982,14 @@ If changing the source code is not an option there is also a resolve options cal
}
}
if (err) return callback(err);
if (err) return callback(err);
const parsedResult =
identToLoaderReques
t(result);
const parsedResult =
this._parseResourceWithoutFragmen
t(result);
const resolved = {
const resolved = {
loader: parsedResult.
loader
,
loader: parsedResult.
path
,
options:
options:
item.options === undefined
item.options === undefined
? parsedResult.options
? parsedResult.query
? parsedResult.query.slice(1)
: undefined
: item.options,
: item.options,
ident: item.options === undefined ? undefined : item.ident
ident: item.options === undefined ? undefined : item.ident
};
};
...
@@ -51311,7 +51404,7 @@ const createDefaultHandler = (profile, logger) => {
...
@@ -51311,7 +51404,7 @@ const createDefaultHandler = (profile, logger) => {
/**
/**
* @callback ReportProgress
* @callback ReportProgress
* @param {number} p
* @param {number} p
* @param {...string
[]
} [args]
* @param {...string} [args]
* @returns {void}
* @returns {void}
*/
*/
...
@@ -55963,6 +56056,7 @@ module.exports.NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS =
...
@@ -55963,6 +56056,7 @@ module.exports.NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS =
const mime = __webpack_require__(78585);
const { basename, extname } = __webpack_require__(71017);
const { basename, extname } = __webpack_require__(71017);
const util = __webpack_require__(73837);
const util = __webpack_require__(73837);
const Chunk = __webpack_require__(39385);
const Chunk = __webpack_require__(39385);
...
@@ -56075,29 +56169,53 @@ const replacePathVariables = (path, data, assetInfo) => {
...
@@ -56075,29 +56169,53 @@ const replacePathVariables = (path, data, assetInfo) => {
// [name] - file
// [name] - file
// [ext] - .js
// [ext] - .js
if (typeof data.filename === "string") {
if (typeof data.filename === "string") {
const { path: file, query, fragment } = parseResource(data.filename);
// check that filename is data uri
let match = data.filename.match(/^data:([^;,]+)/);
const ext = extname(file);
if (match) {
const base = basename(file);
const ext = mime.extension(match[1]);
const name = base.slice(0, base.length - ext.length);
const emptyReplacer = replacer("", true);
const path = file.slice(0, file.length - base.length);
replacements.set("file", emptyReplacer);
replacements.set("file", replacer(file));
replacements.set("query", emptyReplacer);
replacements.set("query", replacer(query, true));
replacements.set("fragment", emptyReplacer);
replacements.set("fragment", replacer(fragment, true));
replacements.set("path", emptyReplacer);
replacements.set("path", replacer(path, true));
replacements.set("base", emptyReplacer);
replacements.set("base", replacer(base));
replacements.set("name", emptyReplacer);
replacements.set("name", replacer(name));
replacements.set("ext", replacer(ext ? `.${ext}` : "", true));
replacements.set("ext", replacer(ext, true));
// Legacy
// Legacy
replacements.set(
replacements.set(
"filebase",
"filebase",
deprecated(
deprecated(
emptyReplacer,
replacer(base),
"[filebase] is now [base]",
"[filebase] is now [base]",
"DEP_WEBPACK_TEMPLATE_PATH_PLUGIN_REPLACE_PATH_VARIABLES_FILENAME"
"DEP_WEBPACK_TEMPLATE_PATH_PLUGIN_REPLACE_PATH_VARIABLES_FILENAME"
)
)
);
);
} else {
const { path: file, query, fragment } = parseResource(data.filename);
const ext = extname(file);
const base = basename(file);
const name = base.slice(0, base.length - ext.length);
const path = file.slice(0, file.length - base.length);
replacements.set("file", replacer(file));
replacements.set("query", replacer(query, true));
replacements.set("fragment", replacer(fragment, true));
replacements.set("path", replacer(path, true));
replacements.set("base", replacer(base));
replacements.set("name", replacer(name));
replacements.set("ext", replacer(ext, true));
// Legacy
replacements.set(
"filebase",
deprecated(
replacer(base),
"[filebase] is now [base]",
"DEP_WEBPACK_TEMPLATE_PATH_PLUGIN_REPLACE_PATH_VARIABLES_FILENAME"
)
);
}
}
}
// Compilation context
// Compilation context
...
@@ -58118,6 +58236,7 @@ const Generator = __webpack_require__(93401);
...
@@ -58118,6 +58236,7 @@ const Generator = __webpack_require__(93401);
const RuntimeGlobals = __webpack_require__(16475);
const RuntimeGlobals = __webpack_require__(16475);
const createHash = __webpack_require__(49835);
const createHash = __webpack_require__(49835);
const { makePathsRelative } = __webpack_require__(82186);
const { makePathsRelative } = __webpack_require__(82186);
const nonNumericOnlyHash = __webpack_require__(55668);
/** @typedef {import("webpack-sources").Source} Source */
/** @typedef {import("webpack-sources").Source} Source */
/** @typedef {import("../../declarations/WebpackOptions").AssetGeneratorOptions} AssetGeneratorOptions */
/** @typedef {import("../../declarations/WebpackOptions").AssetGeneratorOptions} AssetGeneratorOptions */
...
@@ -58338,8 +58457,8 @@ class AssetGenerator extends Generator {
...
@@ -58338,8 +58457,8 @@ class AssetGenerator extends Generator {
const fullHash = /** @type {string} */ (
const fullHash = /** @type {string} */ (
hash.digest(runtimeTemplate.outputOptions.hashDigest)
hash.digest(runtimeTemplate.outputOptions.hashDigest)
);
);
const contentHash =
fullHash.slice
(
const contentHash =
nonNumericOnlyHash
(
0
,
fullHash
,
runtimeTemplate.outputOptions.hashDigestLength
runtimeTemplate.outputOptions.hashDigestLength
);
);
module.buildInfo.fullContentHash = fullHash;
module.buildInfo.fullContentHash = fullHash;
...
@@ -60103,7 +60222,7 @@ const visitModules = (
...
@@ -60103,7 +60222,7 @@ const visitModules = (
const module = it.value;
const module = it.value;
if (
if (
availableModules.has(module) ||
availableModules.has(module) ||
availableModules.plus.has(m)
availableModules.plus.has(m
odule
)
) {
) {
cachedMinAvailableModules.add(module);
cachedMinAvailableModules.add(module);
}
}
...
@@ -62690,6 +62809,11 @@ class ResolverCachePlugin {
...
@@ -62690,6 +62809,11 @@ class ResolverCachePlugin {
fileDependencies: new LazySet(),
fileDependencies: new LazySet(),
contextDependencies: new LazySet()
contextDependencies: new LazySet()
};
};
let yieldResult;
if (typeof newResolveContext.yield === "function") {
yieldResult = [];
newResolveContext.yield = obj => yieldResult.push(obj);
}
const propagate = key => {
const propagate = key => {
if (resolveContext[key]) {
if (resolveContext[key]) {
addAllToSet(resolveContext[key], newResolveContext[key]);
addAllToSet(resolveContext[key], newResolveContext[key]);
...
@@ -62717,15 +62841,19 @@ class ResolverCachePlugin {
...
@@ -62717,15 +62841,19 @@ class ResolverCachePlugin {
snapshotOptions,
snapshotOptions,
(err, snapshot) => {
(err, snapshot) => {
if (err) return callback(err);
if (err) return callback(err);
const resolveResult = result || yieldResult;
if (!snapshot) {
if (!snapshot) {
if (res
ult) return callback(null, r
esult);
if (res
olveResult) return callback(null, resolveR
esult);
return callback();
return callback();
}
}
itemCache.store(new CacheEntry(result, snapshot), storeErr => {
itemCache.store(
if (storeErr) return callback(storeErr);
new CacheEntry(resolveResult, snapshot),
if (result) return callback(null, result);
storeErr => {
callback();
if (storeErr) return callback(storeErr);
});
if (resolveResult) return callback(null, resolveResult);
callback();
}
);
}
}
);
);
}
}
...
@@ -62735,6 +62863,8 @@ class ResolverCachePlugin {
...
@@ -62735,6 +62863,8 @@ class ResolverCachePlugin {
factory(type, hook) {
factory(type, hook) {
/** @type {Map<string, (function(Error=, Object=): void)[]>} */
/** @type {Map<string, (function(Error=, Object=): void)[]>} */
const activeRequests = new Map();
const activeRequests = new Map();
/** @type {Map<string, [function(Error=, Object=): void, function(Error=, Object=): void][]>} */
const activeRequestsWithYield = new Map();
hook.tap(
hook.tap(
"ResolverCachePlugin",
"ResolverCachePlugin",
/**
/**
...
@@ -62759,29 +62889,63 @@ class ResolverCachePlugin {
...
@@ -62759,29 +62889,63 @@ class ResolverCachePlugin {
if (request._ResolverCachePluginCacheMiss || !fileSystemInfo) {
if (request._ResolverCachePluginCacheMiss || !fileSystemInfo) {
return callback();
return callback();
}
}
const identifier = `${type}${optionsIdent}${objectToString(
const withYield = typeof resolveContext.yield === "function";
request,
const identifier = `${type}${
!cacheWithContext
withYield ? "|yield" : "|default"
)}`;
}${optionsIdent}${objectToString(request, !cacheWithContext)}`;
const activeRequest = activeRequests.get(identifier);
if (activeRequest) {
if (withYield) {
activeRequest.push(callback);
const activeRequest = activeRequestsWithYield.get(identifier);
return;
if (activeRequest) {
activeRequest[0].push(callback);
activeRequest[1].push(resolveContext.yield);
return;
}
} else {
const activeRequest = activeRequests.get(identifier);
if (activeRequest) {
activeRequest.push(callback);
return;
}
}
}
const itemCache = cache.getItemCache(identifier, null);
const itemCache = cache.getItemCache(identifier, null);
let callbacks;
let callbacks, yields;
const done = (err, result) => {
const done = withYield
if (callbacks === undefined) {
? (err, result) => {
callback(err, result);
if (callbacks === undefined) {
callbacks = false;
if (err) {
} else {
callback(err);
for (const callback of callbacks) {
} else {
callback(err, result);
if (result)
}
for (const r of result) resolveContext.yield(r);
activeRequests.delete(identifier);
callback(null, null);
callbacks = false;
}
}
yields = undefined;
};
callbacks = false;
} else {
for (let i = 0; i < callbacks.length; i++) {
const cb = callbacks[i];
const yield_ = yields[i];
if (result) for (const r of result) yield_(r);
cb(null, null);
}
activeRequestsWithYield.delete(identifier);
yields = undefined;
callbacks = false;
}
}
: (err, result) => {
if (callbacks === undefined) {
callback(err, result);
callbacks = false;
} else {
for (const callback of callbacks) {
callback(err, result);
}
activeRequests.delete(identifier);
callbacks = false;
}
};
/**
/**
* @param {Error=} err error if any
* @param {Error=} err error if any
* @param {CacheEntry=} cacheEntry cache entry
* @param {CacheEntry=} cacheEntry cache entry
...
@@ -62838,7 +63002,14 @@ class ResolverCachePlugin {
...
@@ -62838,7 +63002,14 @@ class ResolverCachePlugin {
}
}
};
};
itemCache.get(processCacheResult);
itemCache.get(processCacheResult);
if (callbacks === undefined) {
if (withYield && callbacks === undefined) {
callbacks = [callback];
yields = [resolveContext.yield];
activeRequestsWithYield.set(
identifier,
/** @type {[any, any]} */ ([callbacks, yields])
);
} else if (callbacks === undefined) {
callbacks = [callback];
callbacks = [callback];
activeRequests.set(identifier, callbacks);
activeRequests.set(identifier, callbacks);
}
}
...
@@ -64946,6 +65117,7 @@ const applyOutputDefaults = (
...
@@ -64946,6 +65117,7 @@ const applyOutputDefaults = (
D(output, "strictModuleExceptionHandling", false);
D(output, "strictModuleExceptionHandling", false);
const optimistic = v => v || v === undefined;
const optimistic = v => v || v === undefined;
const conditionallyOptimistic = (v, c) => (v === undefined && c) || v;
F(
F(
output.environment,
output.environment,
"arrowFunction",
"arrowFunction",
...
@@ -64959,8 +65131,12 @@ const applyOutputDefaults = (
...
@@ -64959,8 +65131,12 @@ const applyOutputDefaults = (
);
);
F(output.environment, "forOf", () => tp && optimistic(tp.forOf));
F(output.environment, "forOf", () => tp && optimistic(tp.forOf));
F(output.environment, "bigIntLiteral", () => tp && tp.bigIntLiteral);
F(output.environment, "bigIntLiteral", () => tp && tp.bigIntLiteral);
F(output.environment, "dynamicImport", () => tp && tp.dynamicImport);
F(output.environment, "dynamicImport", () =>
F(output.environment, "module", () => tp && tp.module);
conditionallyOptimistic(tp && tp.dynamicImport, output.module)
);
F(output.environment, "module", () =>
conditionallyOptimistic(tp && tp.module, output.module)
);
const { trustedTypes } = output;
const { trustedTypes } = output;
if (trustedTypes) {
if (trustedTypes) {
...
@@ -68350,78 +68526,71 @@ class CssLoadingRuntimeModule extends RuntimeModule {
...
@@ -68350,78 +68526,71 @@ class CssLoadingRuntimeModule extends RuntimeModule {
"",
"",
withLoading
withLoading
? Template.asString([
? Template.asString([
`${fn}.css = ${runtimeTemplate.basicFunction(
`${fn}.css = ${runtimeTemplate.basicFunction("chunkId, promises", [
"chunkId, promises",
"// css chunk loading",
hasCssMatcher !== false
`var installedChunkData = ${RuntimeGlobals.hasOwnProperty}(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;`,
? [
'if(installedChunkData !== 0) { // 0 means "already installed".',
"// css chunk loading",
Template.indent([
`var installedChunkData = ${RuntimeGlobals.hasOwnProperty}(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;`,
"",
'if(installedChunkData !== 0) { // 0 means "already installed".',
'// a Promise means "currently loading".',
Template.indent([
"if(installedChunkData) {",
"",
Template.indent(["promises.push(installedChunkData[2]);"]),
'// a Promise means "currently loading".',
"} else {",
"if(installedChunkData) {",
Template.indent([
Template.indent([
hasCssMatcher === true
"promises.push(installedChunkData[2]);"
? "if(true) { // all chunks have CSS"
]),
: `if(${hasCssMatcher("chunkId")}) {`,
"} else {",
Template.indent([
Template.indent([
"// setup Promise in chunk cache",
hasCssMatcher === true
`var promise = new Promise(${runtimeTemplate.expressionFunction(
? "if(true) { // all chunks have CSS"
`installedChunkData = installedChunks[chunkId] = [resolve, reject]`,
: `if(${hasCssMatcher("chunkId")}) {`,
"resolve, reject"
)});`,
"promises.push(installedChunkData[2] = promise);",
"",
"// start chunk loading",
`var url = ${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkCssFilename}(chunkId);`,
"// create error before stack unwound to get useful stacktrace later",
"var error = new Error();",
`var loadingEnded = ${runtimeTemplate.basicFunction(
"event",
[
`if(${RuntimeGlobals.hasOwnProperty}(installedChunks, chunkId)) {`,
Template.indent([
Template.indent([
"// setup Promise in chunk cache",
"installedChunkData = installedChunks[chunkId];",
`var promise = new Promise(${runtimeTemplate.expressionFunction(
"if(installedChunkData !== 0) installedChunks[chunkId] = undefined;",
`installedChunkData = installedChunks[chunkId] = [resolve, reject]`,
"if(installedChunkData) {",
"resolve, reject"
Template.indent([
)});`,
'if(event.type !== "load") {',
"promises.push(installedChunkData[2] = promise);",
Template.indent([
"",
"var errorType = event && event.type;",
"// start chunk loading",
"var realSrc = event && event.target && event.target.src;",
`var url = ${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkCssFilename}(chunkId);`,
"error.message = 'Loading css chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';",
"// create error before stack unwound to get useful stacktrace later",
"error.name = 'ChunkLoadError';",
"var error = new Error();",
"error.type = errorType;",
`var loadingEnded = ${runtimeTemplate.basicFunction(
"error.request = realSrc;",
"event",
"installedChunkData[1](error);"
[
]),
`if(${RuntimeGlobals.hasOwnProperty}(installedChunks, chunkId)) {`,
"} else {",
Template.indent([
Template.indent([
"installedChunkData = installedChunks[chunkId];",
`loadCssChunkData(${RuntimeGlobals.moduleFactories}, link, chunkId);`,
"if(installedChunkData !== 0) installedChunks[chunkId] = undefined;",
"installedChunkData[0]();"
"if(installedChunkData) {",
]),
Template.indent([
"}"
'if(event.type !== "load") {',
]),
Template.indent([
"}"
"var errorType = event && event.type;",
"var realSrc = event && event.target && event.target.src;",
"error.message = 'Loading css chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';",
"error.name = 'ChunkLoadError';",
"error.type = errorType;",
"error.request = realSrc;",
"installedChunkData[1](error);"
]),
"} else {",
Template.indent([
`loadCssChunkData(${RuntimeGlobals.moduleFactories}, link, chunkId);`,
"installedChunkData[0]();"
]),
"}"
]),
"}"
]),
"}"
]
)};`,
"var link = loadStylesheet(chunkId, url, loadingEnded);"
]),
]),
"} else installedChunks[chunkId] = 0;"
"}"
]),
]
"}"
)};`,
]),
"var link = loadStylesheet(chunkId, url, loadingEnded);"
"}"
]),
]
"} else installedChunks[chunkId] = 0;"
: "installedChunks[chunkId] = 0;"
]),
)};`
"}"
]),
"}"
])};`
])
])
: "// no chunk loading",
: "// no chunk loading",
"",
"",
...
@@ -68550,6 +68719,7 @@ const { compareModulesByIdentifier } = __webpack_require__(29579);
...
@@ -68550,6 +68719,7 @@ const { compareModulesByIdentifier } = __webpack_require__(29579);
const createSchemaValidation = __webpack_require__(32540);
const createSchemaValidation = __webpack_require__(32540);
const createHash = __webpack_require__(49835);
const createHash = __webpack_require__(49835);
const memoize = __webpack_require__(78676);
const memoize = __webpack_require__(78676);
const nonNumericOnlyHash = __webpack_require__(55668);
const CssExportsGenerator = __webpack_require__(91254);
const CssExportsGenerator = __webpack_require__(91254);
const CssGenerator = __webpack_require__(46061);
const CssGenerator = __webpack_require__(46061);
const CssParser = __webpack_require__(98305);
const CssParser = __webpack_require__(98305);
...
@@ -68732,7 +68902,7 @@ class CssModulesPlugin {
...
@@ -68732,7 +68902,7 @@ class CssModulesPlugin {
hash.update(chunkGraph.getModuleHash(module, chunk.runtime));
hash.update(chunkGraph.getModuleHash(module, chunk.runtime));
}
}
const digest = /** @type {string} */ (hash.digest(hashDigest));
const digest = /** @type {string} */ (hash.digest(hashDigest));
chunk.contentHash.css =
digest.substr(0
, hashDigestLength);
chunk.contentHash.css =
nonNumericOnlyHash(digest
, hashDigestLength);
});
});
compilation.hooks.renderManifest.tap(plugin, (result, options) => {
compilation.hooks.renderManifest.tap(plugin, (result, options) => {
const { chunkGraph } = compilation;
const { chunkGraph } = compilation;
...
@@ -70636,7 +70806,8 @@ const interceptAllJavascriptModulesPluginHooks = (compilation, tracer) => {
...
@@ -70636,7 +70806,8 @@ const interceptAllJavascriptModulesPluginHooks = (compilation, tracer) => {
};
};
const makeInterceptorFor = (instance, tracer) => hookName => ({
const makeInterceptorFor = (instance, tracer) => hookName => ({
register: ({ name, type, context, fn }) => {
register: tapInfo => {
const { name, type, fn } = tapInfo;
const newFn =
const newFn =
// Don't tap our own hooks to ensure stream can close cleanly
// Don't tap our own hooks to ensure stream can close cleanly
name === pluginName
name === pluginName
...
@@ -70647,9 +70818,7 @@ const makeInterceptorFor = (instance, tracer) => hookName => ({
...
@@ -70647,9 +70818,7 @@ const makeInterceptorFor = (instance, tracer) => hookName => ({
fn
fn
});
});
return {
return {
name,
...tapInfo,
type,
context,
fn: newFn
fn: newFn
};
};
}
}
...
@@ -75184,12 +75353,18 @@ class ContextElementDependency extends ModuleDependency {
...
@@ -75184,12 +75353,18 @@ class ContextElementDependency extends ModuleDependency {
}
}
serialize(context) {
serialize(context) {
context.write(this.referencedExports);
const { write } = context;
write(this._typePrefix);
write(this._category);
write(this.referencedExports);
super.serialize(context);
super.serialize(context);
}
}
deserialize(context) {
deserialize(context) {
this.referencedExports = context.read();
const { read } = context;
this._typePrefix = read();
this._category = read();
this.referencedExports = read();
super.deserialize(context);
super.deserialize(context);
}
}
}
}
...
@@ -76123,6 +76298,12 @@ const getProperty = (moduleGraph, module, exportName, property, runtime) => {
...
@@ -76123,6 +76298,12 @@ const getProperty = (moduleGraph, module, exportName, property, runtime) => {
}
}
}
}
switch (property) {
switch (property) {
case "canMangle": {
const exportsInfo = moduleGraph.getExportsInfo(module);
const exportInfo = exportsInfo.getExportInfo(exportName);
if (exportInfo) return exportInfo.canMangle;
return exportsInfo.otherExportsInfo.canMangle;
}
case "used":
case "used":
return (
return (
moduleGraph.getExportsInfo(module).getUsed(exportName, runtime) !==
moduleGraph.getExportsInfo(module).getUsed(exportName, runtime) !==
...
@@ -87945,6 +88126,7 @@ const memoize = __webpack_require__(78676);
...
@@ -87945,6 +88126,7 @@ const memoize = __webpack_require__(78676);
/** @typedef {import("../declarations/WebpackOptions").Entry} Entry */
/** @typedef {import("../declarations/WebpackOptions").Entry} Entry */
/** @typedef {import("../declarations/WebpackOptions").EntryNormalized} EntryNormalized */
/** @typedef {import("../declarations/WebpackOptions").EntryNormalized} EntryNormalized */
/** @typedef {import("../declarations/WebpackOptions").EntryObject} EntryObject */
/** @typedef {import("../declarations/WebpackOptions").EntryObject} EntryObject */
/** @typedef {import("../declarations/WebpackOptions").FileCacheOptions} FileCacheOptions */
/** @typedef {import("../declarations/WebpackOptions").LibraryOptions} LibraryOptions */
/** @typedef {import("../declarations/WebpackOptions").LibraryOptions} LibraryOptions */
/** @typedef {import("../declarations/WebpackOptions").ModuleOptions} ModuleOptions */
/** @typedef {import("../declarations/WebpackOptions").ModuleOptions} ModuleOptions */
/** @typedef {import("../declarations/WebpackOptions").ResolveOptions} ResolveOptions */
/** @typedef {import("../declarations/WebpackOptions").ResolveOptions} ResolveOptions */
...
@@ -87960,11 +88142,15 @@ const memoize = __webpack_require__(78676);
...
@@ -87960,11 +88142,15 @@ const memoize = __webpack_require__(78676);
/** @typedef {import("../declarations/WebpackOptions").WebpackPluginInstance} WebpackPluginInstance */
/** @typedef {import("../declarations/WebpackOptions").WebpackPluginInstance} WebpackPluginInstance */
/** @typedef {import("./Compilation").Asset} Asset */
/** @typedef {import("./Compilation").Asset} Asset */
/** @typedef {import("./Compilation").AssetInfo} AssetInfo */
/** @typedef {import("./Compilation").AssetInfo} AssetInfo */
/** @typedef {import("./Compilation").EntryOptions} EntryOptions */
/** @typedef {import("./Compiler").AssetEmittedInfo} AssetEmittedInfo */
/** @typedef {import("./MultiStats")} MultiStats */
/** @typedef {import("./MultiStats")} MultiStats */
/** @typedef {import("./Parser").ParserState} ParserState */
/** @typedef {import("./Parser").ParserState} ParserState */
/** @typedef {import("./ResolverFactory").ResolvePluginInstance} ResolvePluginInstance */
/** @typedef {import("./ResolverFactory").ResolvePluginInstance} ResolvePluginInstance */
/** @typedef {import("./ResolverFactory").Resolver} Resolver */
/** @typedef {import("./ResolverFactory").Resolver} Resolver */
/** @typedef {import("./Watching")} Watching */
/** @typedef {import("./Watching")} Watching */
/** @typedef {import("./cli").Argument} Argument */
/** @typedef {import("./cli").Problem} Problem */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsAsset} StatsAsset */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsAsset} StatsAsset */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsChunk} StatsChunk */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsChunk} StatsChunk */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsChunkGroup} StatsChunkGroup */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsChunkGroup} StatsChunkGroup */
...
@@ -89770,6 +89956,7 @@ const { last, someInIterable } = __webpack_require__(39104);
...
@@ -89770,6 +89956,7 @@ const { last, someInIterable } = __webpack_require__(39104);
const StringXor = __webpack_require__(40293);
const StringXor = __webpack_require__(40293);
const { compareModulesByIdentifier } = __webpack_require__(29579);
const { compareModulesByIdentifier } = __webpack_require__(29579);
const createHash = __webpack_require__(49835);
const createHash = __webpack_require__(49835);
const nonNumericOnlyHash = __webpack_require__(55668);
const { intersectRuntime } = __webpack_require__(17156);
const { intersectRuntime } = __webpack_require__(17156);
const JavascriptGenerator = __webpack_require__(77106);
const JavascriptGenerator = __webpack_require__(77106);
const JavascriptParser = __webpack_require__(29050);
const JavascriptParser = __webpack_require__(29050);
...
@@ -89848,6 +90035,7 @@ const printGeneratedCodeForStack = (module, code) => {
...
@@ -89848,6 +90035,7 @@ const printGeneratedCodeForStack = (module, code) => {
/**
/**
* @typedef {Object} RenderBootstrapContext
* @typedef {Object} RenderBootstrapContext
* @property {Chunk} chunk the chunk
* @property {Chunk} chunk the chunk
* @property {CodeGenerationResults} codeGenerationResults results of code generation
* @property {RuntimeTemplate} runtimeTemplate the runtime template
* @property {RuntimeTemplate} runtimeTemplate the runtime template
* @property {ModuleGraph} moduleGraph the module graph
* @property {ModuleGraph} moduleGraph the module graph
* @property {ChunkGraph} chunkGraph the chunk graph
* @property {ChunkGraph} chunkGraph the chunk graph
...
@@ -90077,6 +90265,7 @@ class JavascriptModulesPlugin {
...
@@ -90077,6 +90265,7 @@ class JavascriptModulesPlugin {
{
{
hash: "0000",
hash: "0000",
chunk,
chunk,
codeGenerationResults: context.codeGenerationResults,
chunkGraph: context.chunkGraph,
chunkGraph: context.chunkGraph,
moduleGraph: context.moduleGraph,
moduleGraph: context.moduleGraph,
runtimeTemplate: context.runtimeTemplate
runtimeTemplate: context.runtimeTemplate
...
@@ -90089,6 +90278,7 @@ class JavascriptModulesPlugin {
...
@@ -90089,6 +90278,7 @@ class JavascriptModulesPlugin {
compilation.hooks.contentHash.tap("JavascriptModulesPlugin", chunk => {
compilation.hooks.contentHash.tap("JavascriptModulesPlugin", chunk => {
const {
const {
chunkGraph,
chunkGraph,
codeGenerationResults,
moduleGraph,
moduleGraph,
runtimeTemplate,
runtimeTemplate,
outputOptions: {
outputOptions: {
...
@@ -90106,6 +90296,7 @@ class JavascriptModulesPlugin {
...
@@ -90106,6 +90296,7 @@ class JavascriptModulesPlugin {
{
{
hash: "0000",
hash: "0000",
chunk,
chunk,
codeGenerationResults,
chunkGraph: compilation.chunkGraph,
chunkGraph: compilation.chunkGraph,
moduleGraph: compilation.moduleGraph,
moduleGraph: compilation.moduleGraph,
runtimeTemplate: compilation.runtimeTemplate
runtimeTemplate: compilation.runtimeTemplate
...
@@ -90118,6 +90309,7 @@ class JavascriptModulesPlugin {
...
@@ -90118,6 +90309,7 @@ class JavascriptModulesPlugin {
}
}
hooks.chunkHash.call(chunk, hash, {
hooks.chunkHash.call(chunk, hash, {
chunkGraph,
chunkGraph,
codeGenerationResults,
moduleGraph,
moduleGraph,
runtimeTemplate
runtimeTemplate
});
});
...
@@ -90144,7 +90336,10 @@ class JavascriptModulesPlugin {
...
@@ -90144,7 +90336,10 @@ class JavascriptModulesPlugin {
xor.updateHash(hash);
xor.updateHash(hash);
}
}
const digest = /** @type {string} */ (hash.digest(hashDigest));
const digest = /** @type {string} */ (hash.digest(hashDigest));
chunk.contentHash.javascript = digest.substr(0, hashDigestLength);
chunk.contentHash.javascript = nonNumericOnlyHash(
digest,
hashDigestLength
);
});
});
compilation.hooks.additionalTreeRuntimeRequirements.tap(
compilation.hooks.additionalTreeRuntimeRequirements.tap(
"JavascriptModulesPlugin",
"JavascriptModulesPlugin",
...
@@ -90720,7 +90915,13 @@ class JavascriptModulesPlugin {
...
@@ -90720,7 +90915,13 @@ class JavascriptModulesPlugin {
* @returns {{ header: string[], beforeStartup: string[], startup: string[], afterStartup: string[], allowInlineStartup: boolean }} the generated source of the bootstrap code
* @returns {{ header: string[], beforeStartup: string[], startup: string[], afterStartup: string[], allowInlineStartup: boolean }} the generated source of the bootstrap code
*/
*/
renderBootstrap(renderContext, hooks) {
renderBootstrap(renderContext, hooks) {
const { chunkGraph, moduleGraph, chunk, runtimeTemplate } = renderContext;
const {
chunkGraph,
codeGenerationResults,
moduleGraph,
chunk,
runtimeTemplate
} = renderContext;
const runtimeRequirements = chunkGraph.getTreeRuntimeRequirements(chunk);
const runtimeRequirements = chunkGraph.getTreeRuntimeRequirements(chunk);
...
@@ -90844,8 +91045,18 @@ class JavascriptModulesPlugin {
...
@@ -90844,8 +91045,18 @@ class JavascriptModulesPlugin {
);
);
result.allowInlineStartup = false;
result.allowInlineStartup = false;
}
}
let data;
if (codeGenerationResults.has(entryModule, chunk.runtime)) {
const result = codeGenerationResults.get(
entryModule,
chunk.runtime
);
data = result.data;
}
if (
if (
result.allowInlineStartup &&
result.allowInlineStartup &&
(!data || !data.get("topLevelDeclarations")) &&
(!entryModule.buildInfo ||
(!entryModule.buildInfo ||
!entryModule.buildInfo.topLevelDeclarations)
!entryModule.buildInfo.topLevelDeclarations)
) {
) {
...
@@ -95012,6 +95223,7 @@ const { getAllChunks } = __webpack_require__(91145);
...
@@ -95012,6 +95223,7 @@ const { getAllChunks } = __webpack_require__(91145);
/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../Compilation")} Compilation */
/** @typedef {import("../Compilation")} Compilation */
/** @typedef {import("../ChunkGraph")} ChunkGraph */
/** @typedef {import("../ChunkGraph")} ChunkGraph */
/** @typedef {import("../ChunkGraph").EntryModuleWithChunkGroup} EntryModuleWithChunkGroup */
/** @typedef {import("../ChunkGroup")} ChunkGroup */
/** @typedef {import("../ChunkGroup")} ChunkGroup */
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
/** @typedef {(string|number)[]} EntryItem */
/** @typedef {(string|number)[]} EntryItem */
...
@@ -95021,7 +95233,7 @@ const EXPORT_PREFIX = "var __webpack_exports__ = ";
...
@@ -95021,7 +95233,7 @@ const EXPORT_PREFIX = "var __webpack_exports__ = ";
/**
/**
* @param {ChunkGraph} chunkGraph chunkGraph
* @param {ChunkGraph} chunkGraph chunkGraph
* @param {RuntimeTemplate} runtimeTemplate runtimeTemplate
* @param {RuntimeTemplate} runtimeTemplate runtimeTemplate
* @param {
import("../ChunkGraph").
EntryModuleWithChunkGroup[]} entries entries
* @param {EntryModuleWithChunkGroup[]} entries entries
* @param {Chunk} chunk chunk
* @param {Chunk} chunk chunk
* @param {boolean} passive true: passive startup with on chunks loaded
* @param {boolean} passive true: passive startup with on chunks loaded
* @returns {string} runtime code
* @returns {string} runtime code
...
@@ -95099,7 +95311,7 @@ exports.generateEntryStartup = (
...
@@ -95099,7 +95311,7 @@ exports.generateEntryStartup = (
/**
/**
* @param {Hash} hash the hash to update
* @param {Hash} hash the hash to update
* @param {ChunkGraph} chunkGraph chunkGraph
* @param {ChunkGraph} chunkGraph chunkGraph
* @param {
import("../ChunkGraph").
EntryModuleWithChunkGroup[]} entries entries
* @param {EntryModuleWithChunkGroup[]} entries entries
* @param {Chunk} chunk chunk
* @param {Chunk} chunk chunk
* @returns {void}
* @returns {void}
*/
*/
...
@@ -96205,9 +96417,15 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin {
...
@@ -96205,9 +96417,15 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin {
* @param {LibraryContext<T>} libraryContext context
* @param {LibraryContext<T>} libraryContext context
* @returns {string | undefined} bailout reason
* @returns {string | undefined} bailout reason
*/
*/
embedInRuntimeBailout(module, { chunk }, { options, compilation }) {
embedInRuntimeBailout(
module,
{ chunk, codeGenerationResults },
{ options, compilation }
) {
const { data } = codeGenerationResults.get(module, chunk.runtime);
const topLevelDeclarations =
const topLevelDeclarations =
module.buildInfo && module.buildInfo.topLevelDeclarations;
(data && data.get("topLevelDeclarations")) ||
(module.buildInfo && module.buildInfo.topLevelDeclarations);
if (!topLevelDeclarations)
if (!topLevelDeclarations)
return "it doesn't tell about top level declarations.";
return "it doesn't tell about top level declarations.";
const fullNameResolved = this._getResolvedFullName(
const fullNameResolved = this._getResolvedFullName(
...
@@ -98277,6 +98495,7 @@ const builtins = [
...
@@ -98277,6 +98495,7 @@ const builtins = [
"tty",
"tty",
"url",
"url",
"util",
"util",
"util/types",
"v8",
"v8",
"vm",
"vm",
"wasi",
"wasi",
...
@@ -100695,10 +100914,6 @@ class ConcatenatedModule extends Module {
...
@@ -100695,10 +100914,6 @@ class ConcatenatedModule extends Module {
const topLevelDeclarations = this.buildInfo.topLevelDeclarations;
const topLevelDeclarations = this.buildInfo.topLevelDeclarations;
if (topLevelDeclarations !== undefined) {
if (topLevelDeclarations !== undefined) {
for (const decl of m.buildInfo.topLevelDeclarations) {
for (const decl of m.buildInfo.topLevelDeclarations) {
// reserved names will always be renamed
if (RESERVED_NAMES.has(decl)) continue;
// TODO actually this is incorrect since with renaming there could be more
// We should do the renaming during build
topLevelDeclarations.add(decl);
topLevelDeclarations.add(decl);
}
}
}
}
...
@@ -100986,6 +101201,8 @@ class ConcatenatedModule extends Module {
...
@@ -100986,6 +101201,8 @@ class ConcatenatedModule extends Module {
// List of all used names to avoid conflicts
// List of all used names to avoid conflicts
const allUsedNames = new Set(RESERVED_NAMES);
const allUsedNames = new Set(RESERVED_NAMES);
// Updated Top level declarations are created by renaming
const topLevelDeclarations = new Set();
// List of additional names in scope for module references
// List of additional names in scope for module references
/** @type {Map<string, { usedNames: Set<string>, alreadyCheckedScopes: Set<TODO> }>} */
/** @type {Map<string, { usedNames: Set<string>, alreadyCheckedScopes: Set<TODO> }>} */
...
@@ -101130,6 +101347,7 @@ class ConcatenatedModule extends Module {
...
@@ -101130,6 +101347,7 @@ class ConcatenatedModule extends Module {
);
);
allUsedNames.add(newName);
allUsedNames.add(newName);
info.internalNames.set(name, newName);
info.internalNames.set(name, newName);
topLevelDeclarations.add(newName);
const source = info.source;
const source = info.source;
const allIdentifiers = new Set(
const allIdentifiers = new Set(
references.map(r => r.identifier).concat(variable.identifiers)
references.map(r => r.identifier).concat(variable.identifiers)
...
@@ -101156,6 +101374,7 @@ class ConcatenatedModule extends Module {
...
@@ -101156,6 +101374,7 @@ class ConcatenatedModule extends Module {
} else {
} else {
allUsedNames.add(name);
allUsedNames.add(name);
info.internalNames.set(name, name);
info.internalNames.set(name, name);
topLevelDeclarations.add(name);
}
}
}
}
let namespaceObjectName;
let namespaceObjectName;
...
@@ -101173,6 +101392,7 @@ class ConcatenatedModule extends Module {
...
@@ -101173,6 +101392,7 @@ class ConcatenatedModule extends Module {
allUsedNames.add(namespaceObjectName);
allUsedNames.add(namespaceObjectName);
}
}
info.namespaceObjectName = namespaceObjectName;
info.namespaceObjectName = namespaceObjectName;
topLevelDeclarations.add(namespaceObjectName);
break;
break;
}
}
case "external": {
case "external": {
...
@@ -101184,6 +101404,7 @@ class ConcatenatedModule extends Module {
...
@@ -101184,6 +101404,7 @@ class ConcatenatedModule extends Module {
);
);
allUsedNames.add(externalName);
allUsedNames.add(externalName);
info.name = externalName;
info.name = externalName;
topLevelDeclarations.add(externalName);
break;
break;
}
}
}
}
...
@@ -101196,6 +101417,7 @@ class ConcatenatedModule extends Module {
...
@@ -101196,6 +101417,7 @@ class ConcatenatedModule extends Module {
);
);
allUsedNames.add(externalNameInterop);
allUsedNames.add(externalNameInterop);
info.interopNamespaceObjectName = externalNameInterop;
info.interopNamespaceObjectName = externalNameInterop;
topLevelDeclarations.add(externalNameInterop);
}
}
if (
if (
info.module.buildMeta.exportsType === "default" &&
info.module.buildMeta.exportsType === "default" &&
...
@@ -101209,6 +101431,7 @@ class ConcatenatedModule extends Module {
...
@@ -101209,6 +101431,7 @@ class ConcatenatedModule extends Module {
);
);
allUsedNames.add(externalNameInterop);
allUsedNames.add(externalNameInterop);
info.interopNamespaceObject2Name = externalNameInterop;
info.interopNamespaceObject2Name = externalNameInterop;
topLevelDeclarations.add(externalNameInterop);
}
}
if (
if (
info.module.buildMeta.exportsType === "dynamic" ||
info.module.buildMeta.exportsType === "dynamic" ||
...
@@ -101222,6 +101445,7 @@ class ConcatenatedModule extends Module {
...
@@ -101222,6 +101445,7 @@ class ConcatenatedModule extends Module {
);
);
allUsedNames.add(externalNameInterop);
allUsedNames.add(externalNameInterop);
info.interopDefaultAccessName = externalNameInterop;
info.interopDefaultAccessName = externalNameInterop;
topLevelDeclarations.add(externalNameInterop);
}
}
}
}
...
@@ -101491,6 +101715,7 @@ ${defineGetters}`
...
@@ -101491,6 +101715,7 @@ ${defineGetters}`
const data = new Map();
const data = new Map();
if (chunkInitFragments.length > 0)
if (chunkInitFragments.length > 0)
data.set("chunkInitFragments", chunkInitFragments);
data.set("chunkInitFragments", chunkInitFragments);
data.set("topLevelDeclarations", topLevelDeclarations);
/** @type {CodeGenerationResult} */
/** @type {CodeGenerationResult} */
const resultEntry = {
const resultEntry = {
...
@@ -110956,7 +111181,7 @@ class HttpUriPlugin {
...
@@ -110956,7 +111181,7 @@ class HttpUriPlugin {
/**
/**
* @param {string} url URL
* @param {string} url URL
* @param {FetchResult} cachedResult result from cache
* @param {FetchResult
| RedirectFetchResult
} cachedResult result from cache
* @param {function((Error | null)=, FetchResult=): void} callback callback
* @param {function((Error | null)=, FetchResult=): void} callback callback
* @returns {void}
* @returns {void}
*/
*/
...
@@ -111050,9 +111275,30 @@ class HttpUriPlugin {
...
@@ -111050,9 +111275,30 @@ class HttpUriPlugin {
res.statusCode >= 301 &&
res.statusCode >= 301 &&
res.statusCode <= 308
res.statusCode <= 308
) {
) {
return finishWith(
{
const result =
{
location: new URL(location, url).href
location: new URL(location, url).href
});
};
if (
!cachedResult ||
!("location" in cachedResult) ||
cachedResult.location !== result.location ||
cachedResult.validUntil < validUntil ||
cachedResult.storeLock !== storeLock ||
cachedResult.storeCache !== storeCache ||
cachedResult.etag !== etag
) {
return finishWith(result);
} else {
logger.debug(`GET ${url} [${res.statusCode}] (unchanged)`);
return callback(null, {
...result,
fresh: true,
storeLock,
storeCache,
validUntil,
etag
});
}
}
}
const contentType = res.headers["content-type"] || "";
const contentType = res.headers["content-type"] || "";
const bufferArr = [];
const bufferArr = [];
...
@@ -112598,6 +112844,8 @@ Section -> Buffer
...
@@ -112598,6 +112844,8 @@ Section -> Buffer
// "wpc" + 1 in little-endian
// "wpc" + 1 in little-endian
const VERSION = 0x01637077;
const VERSION = 0x01637077;
const WRITE_LIMIT_TOTAL = 0x7fff0000;
const WRITE_LIMIT_CHUNK = 511 * 1024 * 1024;
/**
/**
* @param {Buffer[]} buffers buffers
* @param {Buffer[]} buffers buffers
...
@@ -112645,7 +112893,7 @@ const readUInt64LE = Buffer.prototype.readBigUInt64LE
...
@@ -112645,7 +112893,7 @@ const readUInt64LE = Buffer.prototype.readBigUInt64LE
* @param {FileMiddleware} middleware this
* @param {FileMiddleware} middleware this
* @param {BufferSerializableType[] | Promise<BufferSerializableType[]>} data data to be serialized
* @param {BufferSerializableType[] | Promise<BufferSerializableType[]>} data data to be serialized
* @param {string | boolean} name file base name
* @param {string | boolean} name file base name
* @param {function(string | false, Buffer[]): Promise<void>} writeFile writes a file
* @param {function(string | false, Buffer[]
, number
): Promise<void>} writeFile writes a file
* @param {string | Hash} hashFunction hash function to use
* @param {string | Hash} hashFunction hash function to use
* @returns {Promise<SerializeResult>} resulting file pointer and promise
* @returns {Promise<SerializeResult>} resulting file pointer and promise
*/
*/
...
@@ -112770,9 +113018,9 @@ const serialize = async (
...
@@ -112770,9 +113018,9 @@ const serialize = async (
if (name === true) {
if (name === true) {
name = hashForName(buf, hashFunction);
name = hashForName(buf, hashFunction);
}
}
backgroundJobs.push(writeFile(name, buf));
let size = 0;
let size = 0;
for (const b of buf) size += b.length;
for (const b of buf) size += b.length;
backgroundJobs.push(writeFile(name, buf, size));
return {
return {
size,
size,
name,
name,
...
@@ -112980,7 +113228,7 @@ class FileMiddleware extends SerializerMiddleware {
...
@@ -112980,7 +113228,7 @@ class FileMiddleware extends SerializerMiddleware {
// It's important that we don't touch existing files during serialization
// It's important that we don't touch existing files during serialization
// because serialize may read existing files (when deserializing)
// because serialize may read existing files (when deserializing)
const allWrittenFiles = new Set();
const allWrittenFiles = new Set();
const writeFile = async (name, content) => {
const writeFile = async (name, content
, size
) => {
const file = name
const file = name
? join(this.fs, filename, `../${name}${extension}`)
? join(this.fs, filename, `../${name}${extension}`)
: filename;
: filename;
...
@@ -112999,10 +113247,7 @@ class FileMiddleware extends SerializerMiddleware {
...
@@ -112999,10 +113247,7 @@ class FileMiddleware extends SerializerMiddleware {
[zConstants.BROTLI_PARAM_MODE]: zConstants.BROTLI_MODE_TEXT,
[zConstants.BROTLI_PARAM_MODE]: zConstants.BROTLI_MODE_TEXT,
[zConstants.BROTLI_PARAM_QUALITY]: 2,
[zConstants.BROTLI_PARAM_QUALITY]: 2,
[zConstants.BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING]: true,
[zConstants.BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING]: true,
[zConstants.BROTLI_PARAM_SIZE_HINT]: content.reduce(
[zConstants.BROTLI_PARAM_SIZE_HINT]: size
(size, b) => size + b.length,
0
)
}
}
});
});
}
}
...
@@ -113014,8 +113259,44 @@ class FileMiddleware extends SerializerMiddleware {
...
@@ -113014,8 +113259,44 @@ class FileMiddleware extends SerializerMiddleware {
stream.on("error", err => reject(err));
stream.on("error", err => reject(err));
stream.on("finish", () => resolve());
stream.on("finish", () => resolve());
}
}
for (const b of content) stream.write(b);
// split into chunks for WRITE_LIMIT_CHUNK size
stream.end();
const chunks = [];
for (const b of content) {
if (b.length < WRITE_LIMIT_CHUNK) {
chunks.push(b);
} else {
for (let i = 0; i < b.length; i += WRITE_LIMIT_CHUNK) {
chunks.push(b.slice(i, i + WRITE_LIMIT_CHUNK));
}
}
}
const len = chunks.length;
let i = 0;
const batchWrite = err => {
// will be handled in "on" error handler
if (err) return;
if (i === len) {
stream.end();
return;
}
// queue up a batch of chunks up to the write limit
// end is exclusive
let end = i;
let sum = chunks[end++].length;
while (end < len) {
sum += chunks[end].length;
if (sum > WRITE_LIMIT_TOTAL) break;
end++;
}
while (i < end - 1) {
stream.write(chunks[i++]);
}
stream.write(chunks[i++], batchWrite);
};
batchWrite();
});
});
if (name) allWrittenFiles.add(file);
if (name) allWrittenFiles.add(file);
};
};
...
@@ -124682,7 +124963,7 @@ const toSimpleString = str => {
...
@@ -124682,7 +124963,7 @@ const toSimpleString = str => {
/**
/**
* @param {Record<string|number, boolean>} map value map
* @param {Record<string|number, boolean>} map value map
* @returns {
true|false|function(string): string
} true/false, when unconditionally true/false, or a template function to determine the value at runtime
* @returns {
boolean|(function(string): string)
} true/false, when unconditionally true/false, or a template function to determine the value at runtime
*/
*/
const compileBooleanMatcher = map => {
const compileBooleanMatcher = map => {
const positiveItems = Object.keys(map).filter(i => map[i]);
const positiveItems = Object.keys(map).filter(i => map[i]);
...
@@ -125863,7 +126144,7 @@ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => {
...
@@ -125863,7 +126144,7 @@ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => {
// return the results
// return the results
return result.map(group => {
return result.map(group => {
/** @type {GroupedItems} */
/** @type {GroupedItems
<T>
} */
return {
return {
key: group.key,
key: group.key,
items: group.nodes.map(node => node.item),
items: group.nodes.map(node => node.item),
...
@@ -126873,7 +127154,49 @@ const requestToAbsolute = (context, relativePath) => {
...
@@ -126873,7 +127154,49 @@ const requestToAbsolute = (context, relativePath) => {
return relativePath;
return relativePath;
};
};
const makeCacheable = fn => {
const makeCacheable = realFn => {
/** @type {WeakMap<object, Map<string, ParsedResource>>} */
const cache = new WeakMap();
const getCache = associatedObjectForCache => {
const entry = cache.get(associatedObjectForCache);
if (entry !== undefined) return entry;
/** @type {Map<string, ParsedResource>} */
const map = new Map();
cache.set(associatedObjectForCache, map);
return map;
};
/**
* @param {string} str the path with query and fragment
* @param {Object=} associatedObjectForCache an object to which the cache will be attached
* @returns {ParsedResource} parsed parts
*/
const fn = (str, associatedObjectForCache) => {
if (!associatedObjectForCache) return realFn(str);
const cache = getCache(associatedObjectForCache);
const entry = cache.get(str);
if (entry !== undefined) return entry;
const result = realFn(str);
cache.set(str, result);
return result;
};
fn.bindCache = associatedObjectForCache => {
const cache = getCache(associatedObjectForCache);
return str => {
const entry = cache.get(str);
if (entry !== undefined) return entry;
const result = realFn(str);
cache.set(str, result);
return result;
};
};
return fn;
};
const makeCacheableWithContext = fn => {
/** @type {WeakMap<object, Map<string, Map<string, string>>>} */
/** @type {WeakMap<object, Map<string, Map<string, string>>>} */
const cache = new WeakMap();
const cache = new WeakMap();
...
@@ -127007,7 +127330,7 @@ const _makePathsRelative = (context, identifier) => {
...
@@ -127007,7 +127330,7 @@ const _makePathsRelative = (context, identifier) => {
.join("");
.join("");
};
};
exports.makePathsRelative = makeCacheable(_makePathsRelative);
exports.makePathsRelative = makeCacheable
WithContext
(_makePathsRelative);
/**
/**
*
*
...
@@ -127022,7 +127345,7 @@ const _makePathsAbsolute = (context, identifier) => {
...
@@ -127022,7 +127345,7 @@ const _makePathsAbsolute = (context, identifier) => {
.join("");
.join("");
};
};
exports.makePathsAbsolute = makeCacheable(_makePathsAbsolute);
exports.makePathsAbsolute = makeCacheable
WithContext
(_makePathsAbsolute);
/**
/**
* @param {string} context absolute context path
* @param {string} context absolute context path
...
@@ -127036,7 +127359,7 @@ const _contextify = (context, request) => {
...
@@ -127036,7 +127359,7 @@ const _contextify = (context, request) => {
.join("!");
.join("!");
};
};
const contextify = makeCacheable(_contextify);
const contextify = makeCacheable
WithContext
(_contextify);
exports.contextify = contextify;
exports.contextify = contextify;
/**
/**
...
@@ -127051,13 +127374,15 @@ const _absolutify = (context, request) => {
...
@@ -127051,13 +127374,15 @@ const _absolutify = (context, request) => {
.join("!");
.join("!");
};
};
const absolutify = makeCacheable(_absolutify);
const absolutify = makeCacheable
WithContext
(_absolutify);
exports.absolutify = absolutify;
exports.absolutify = absolutify;
const PATH_QUERY_FRAGMENT_REGEXP =
const PATH_QUERY_FRAGMENT_REGEXP =
/^((?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/;
/^((?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/;
const PATH_QUERY_REGEXP = /^((?:\0.|[^?\0])*)(\?.*)?$/;
/** @typedef {{ resource: string, path: string, query: string, fragment: string }} ParsedResource */
/** @typedef {{ resource: string, path: string, query: string, fragment: string }} ParsedResource */
/** @typedef {{ resource: string, path: string, query: string }} ParsedResourceWithoutFragment */
/**
/**
* @param {string} str the path with query and fragment
* @param {string} str the path with query and fragment
...
@@ -127072,47 +127397,24 @@ const _parseResource = str => {
...
@@ -127072,47 +127397,24 @@ const _parseResource = str => {
fragment: match[3] || ""
fragment: match[3] || ""
};
};
};
};
exports.parseResource = (realFn => {
exports.parseResource = makeCacheable(_parseResource);
/** @type {WeakMap<object, Map<string, ParsedResource>>} */
const cache = new WeakMap();
const getCache = associatedObjectForCache => {
const entry = cache.get(associatedObjectForCache);
if (entry !== undefined) return entry;
/** @type {Map<string, ParsedResource>} */
const map = new Map();
cache.set(associatedObjectForCache, map);
return map;
};
/**
/**
* @param {string} str the path with query and fragment
* Parse resource, skips fragment part
* @param {Object=} associatedObjectForCache an object to which the cache will be attached
* @param {string} str the path with query and fragment
* @returns {ParsedResource} parsed parts
* @returns {ParsedResourceWithoutFragment} parsed parts
*/
*/
const fn = (str, associatedObjectForCache) => {
const _parseResourceWithoutFragment = str => {
if (!associatedObjectForCache) return realFn(str);
const match = PATH_QUERY_REGEXP.exec(str);
const cache = getCache(associatedObjectForCache);
return {
const entry = cache.get(str);
resource: str,
if (entry !== undefined) return entry;
path: match[1].replace(/\0(.)/g, "$1"),
const result = realFn(str);
query: match[2] ? match[2].replace(/\0(.)/g, "$1") : ""
cache.set(str, result);
return result;
};
fn.bindCache = associatedObjectForCache => {
const cache = getCache(associatedObjectForCache);
return str => {
const entry = cache.get(str);
if (entry !== undefined) return entry;
const result = realFn(str);
cache.set(str, result);
return result;
};
};
};
};
return fn;
exports.parseResourceWithoutFragment = makeCacheable(
})(_parseResource);
_parseResourceWithoutFragment
);
/**
/**
* @param {string} filename the filename which should be undone
* @param {string} filename the filename which should be undone
...
@@ -127443,6 +127745,36 @@ const memoize = fn => {
...
@@ -127443,6 +127745,36 @@ const memoize = fn => {
module.exports = memoize;
module.exports = memoize;
/***/ }),
/***/ 55668:
/***/ (function(module) {
"use strict";
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
const A_CODE = "a".charCodeAt(0);
/**
* @param {string} hash hash
* @param {number} hashLength hash length
* @returns {string} returns hash that has at least one non numeric char
*/
module.exports = (hash, hashLength) => {
if (hashLength < 1) return "";
const slice = hash.slice(0, hashLength);
if (slice.match(/[^\d]/)) return slice;
return `${String.fromCharCode(
A_CODE + (parseInt(hash[0], 10) % 6)
)}${slice.slice(1)}`;
};
/***/ }),
/***/ }),
/***/ 70002:
/***/ 70002:
...
@@ -128725,7 +129057,9 @@ exports.versionLt = versionLt;
...
@@ -128725,7 +129057,9 @@ exports.versionLt = versionLt;
*/
*/
exports.parseRange = str => {
exports.parseRange = str => {
const splitAndConvert = str => {
const splitAndConvert = str => {
return str.split(".").map(item => (`${+item}` === item ? +item : item));
return str
.split(".")
.map(item => (item !== "NaN" && `${+item}` === item ? +item : item));
};
};
// see https://docs.npmjs.com/misc/semver#range-grammar for grammar
// see https://docs.npmjs.com/misc/semver#range-grammar for grammar
const parsePartial = str => {
const parsePartial = str => {
...
@@ -128767,13 +129101,15 @@ exports.parseRange = str => {
...
@@ -128767,13 +129101,15 @@ exports.parseRange = str => {
return [-range[0] - 1, ...range.slice(1)];
return [-range[0] - 1, ...range.slice(1)];
};
};
const parseSimple = str => {
const parseSimple = str => {
// simple ::= primitive | partial | tilde | caret
// simple
::= primitive | partial | tilde | caret
// primitive
::= ( '<' | '>' | '>=' | '<=' | '=' )
partial
// primitive
::= ( '<' | '>' | '>=' | '<=' | '=' | '!' ) ( ' ' ) *
partial
// tilde
::= '~'
partial
// tilde
::= '~' ( ' ' ) *
partial
// caret
::= '^'
partial
// caret
::= '^' ( ' ' ) *
partial
const match = /^(\^|~|<=|<|>=|>|=|v|!)/.exec(str);
const match = /^(\^|~|<=|<|>=|>|=|v|!)/.exec(str);
const start = match ? match[0] : "";
const start = match ? match[0] : "";
const remainder = parsePartial(str.slice(start.length));
const remainder = parsePartial(
start.length ? str.slice(start.length).trim() : str.trim()
);
switch (start) {
switch (start) {
case "^":
case "^":
if (remainder.length > 1 && remainder[1] === 0) {
if (remainder.length > 1 && remainder[1] === 0) {
...
@@ -128827,11 +129163,14 @@ exports.parseRange = str => {
...
@@ -128827,11 +129163,14 @@ exports.parseRange = str => {
return [, ...arr, ...items.slice(1).map(() => fn)];
return [, ...arr, ...items.slice(1).map(() => fn)];
};
};
const parseRange = str => {
const parseRange = str => {
// range ::= hyphen | simple ( ' ' simple ) * | ''
// range ::= hyphen | simple ( ' '
( ' ' ) *
simple ) * | ''
// hyphen ::= partial
' - '
partial
// hyphen ::= partial
( ' ' ) * ' - ' ( ' ' ) *
partial
const items = str.split(
" - "
);
const items = str.split(
/\s+-\s+/
);
if (items.length === 1) {
if (items.length === 1) {
const items = str.trim().split(/\s+/g).map(parseSimple);
const items = str
.trim()
.split(/(?<=[-0-9A-Za-z])\s+/g)
.map(parseSimple);
return combine(items, 2);
return combine(items, 2);
}
}
const a = parsePartial(items[0]);
const a = parsePartial(items[0]);
...
@@ -135437,7 +135776,7 @@ module.exports = class MainFieldPlugin {
...
@@ -135437,7 +135776,7 @@ module.exports = class MainFieldPlugin {
/***/ }),
/***/ }),
/***/
48506
:
/***/
79024
:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
"use strict";
...
@@ -135454,7 +135793,7 @@ const getPaths = __webpack_require__(82918);
...
@@ -135454,7 +135793,7 @@ const getPaths = __webpack_require__(82918);
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
module.exports = class ModulesInHiera
chic
DirectoriesPlugin {
module.exports = class ModulesInHiera
rchical
DirectoriesPlugin {
/**
/**
* @param {string | ResolveStepHook} source source
* @param {string | ResolveStepHook} source source
* @param {string | Array<string>} directories directories
* @param {string | Array<string>} directories directories
...
@@ -135475,7 +135814,7 @@ module.exports = class ModulesInHierachicDirectoriesPlugin {
...
@@ -135475,7 +135814,7 @@ module.exports = class ModulesInHierachicDirectoriesPlugin {
resolver
resolver
.getHook(this.source)
.getHook(this.source)
.tapAsync(
.tapAsync(
"ModulesInHiera
chic
DirectoriesPlugin",
"ModulesInHiera
rchical
DirectoriesPlugin",
(request, resolveContext, callback) => {
(request, resolveContext, callback) => {
const fs = resolver.fileSystem;
const fs = resolver.fileSystem;
const addrs = getPaths(request.path)
const addrs = getPaths(request.path)
...
@@ -135924,6 +136263,7 @@ const {
...
@@ -135924,6 +136263,7 @@ const {
* @property {WriteOnlySet<string>=} missingDependencies dependencies that was not found on file system
* @property {WriteOnlySet<string>=} missingDependencies dependencies that was not found on file system
* @property {Set<StackEntry>=} stack set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
* @property {Set<StackEntry>=} stack set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
* @property {(function(string): void)=} log log function
* @property {(function(string): void)=} log log function
* @property {(function (ResolveRequest): void)=} yield yield result, if provided plugins can return several results
*/
*/
/** @typedef {AsyncSeriesBailHook<[ResolveRequest, ResolveContext], ResolveRequest | null>} ResolveStepHook */
/** @typedef {AsyncSeriesBailHook<[ResolveRequest, ResolveContext], ResolveRequest | null>} ResolveStepHook */
...
@@ -136092,6 +136432,16 @@ class Resolver {
...
@@ -136092,6 +136432,16 @@ class Resolver {
request: request
request: request
};
};
let yield_;
let yieldCalled = false;
if (typeof resolveContext.yield === "function") {
const old = resolveContext.yield;
yield_ = obj => {
yieldCalled = true;
old(obj);
};
}
const message = `resolve '${request}' in '${path}'`;
const message = `resolve '${request}' in '${path}'`;
const finishResolved = result => {
const finishResolved = result => {
...
@@ -136129,6 +136479,7 @@ class Resolver {
...
@@ -136129,6 +136479,7 @@ class Resolver {
parentLog(msg);
parentLog(msg);
log.push(msg);
log.push(msg);
},
},
yield: yield_,
fileDependencies: resolveContext.fileDependencies,
fileDependencies: resolveContext.fileDependencies,
contextDependencies: resolveContext.contextDependencies,
contextDependencies: resolveContext.contextDependencies,
missingDependencies: resolveContext.missingDependencies,
missingDependencies: resolveContext.missingDependencies,
...
@@ -136138,6 +136489,7 @@ class Resolver {
...
@@ -136138,6 +136489,7 @@ class Resolver {
if (err) return callback(err);
if (err) return callback(err);
if (result) return finishResolved(result);
if (result) return finishResolved(result);
if (yieldCalled) return callback(null);
return finishWithoutResolve(log);
return finishWithoutResolve(log);
}
}
...
@@ -136151,6 +136503,7 @@ class Resolver {
...
@@ -136151,6 +136503,7 @@ class Resolver {
message,
message,
{
{
log: undefined,
log: undefined,
yield: yield_,
fileDependencies: resolveContext.fileDependencies,
fileDependencies: resolveContext.fileDependencies,
contextDependencies: resolveContext.contextDependencies,
contextDependencies: resolveContext.contextDependencies,
missingDependencies: resolveContext.missingDependencies,
missingDependencies: resolveContext.missingDependencies,
...
@@ -136160,6 +136513,7 @@ class Resolver {
...
@@ -136160,6 +136513,7 @@ class Resolver {
if (err) return callback(err);
if (err) return callback(err);
if (result) return finishResolved(result);
if (result) return finishResolved(result);
if (yieldCalled) return callback(null);
// log is missing for the error details
// log is missing for the error details
// so we redo the resolving for the log info
// so we redo the resolving for the log info
...
@@ -136174,11 +136528,15 @@ class Resolver {
...
@@ -136174,11 +136528,15 @@ class Resolver {
message,
message,
{
{
log: msg => log.push(msg),
log: msg => log.push(msg),
yield: yield_,
stack: resolveContext.stack
stack: resolveContext.stack
},
},
(err, result)
=> {
err
=> {
if (err) return callback(err);
if (err) return callback(err);
// In a case that there is a race condition and yield will be called
if (yieldCalled) return callback(null);
return finishWithoutResolve(log);
return finishWithoutResolve(log);
}
}
);
);
...
@@ -136217,6 +136575,7 @@ class Resolver {
...
@@ -136217,6 +136575,7 @@ class Resolver {
const innerContext = createInnerContext(
const innerContext = createInnerContext(
{
{
log: resolveContext.log,
log: resolveContext.log,
yield: resolveContext.yield,
fileDependencies: resolveContext.fileDependencies,
fileDependencies: resolveContext.fileDependencies,
contextDependencies: resolveContext.contextDependencies,
contextDependencies: resolveContext.contextDependencies,
missingDependencies: resolveContext.missingDependencies,
missingDependencies: resolveContext.missingDependencies,
...
@@ -136326,7 +136685,7 @@ const ImportsFieldPlugin = __webpack_require__(7317);
...
@@ -136326,7 +136685,7 @@ const ImportsFieldPlugin = __webpack_require__(7317);
const JoinRequestPartPlugin = __webpack_require__(35949);
const JoinRequestPartPlugin = __webpack_require__(35949);
const JoinRequestPlugin = __webpack_require__(5190);
const JoinRequestPlugin = __webpack_require__(5190);
const MainFieldPlugin = __webpack_require__(47450);
const MainFieldPlugin = __webpack_require__(47450);
const ModulesInHiera
chicDirectoriesPlugin = __webpack_require__(48506
);
const ModulesInHiera
rchicalDirectoriesPlugin = __webpack_require__(79024
);
const ModulesInRootPlugin = __webpack_require__(88138);
const ModulesInRootPlugin = __webpack_require__(88138);
const NextPlugin = __webpack_require__(40777);
const NextPlugin = __webpack_require__(40777);
const ParsePlugin = __webpack_require__(97849);
const ParsePlugin = __webpack_require__(97849);
...
@@ -136376,7 +136735,7 @@ const UseFilePlugin = __webpack_require__(96972);
...
@@ -136376,7 +136735,7 @@ const UseFilePlugin = __webpack_require__(96972);
* @property {boolean=} fullySpecified The request is already fully specified and no extensions or directories are resolved for it
* @property {boolean=} fullySpecified The request is already fully specified and no extensions or directories are resolved for it
* @property {boolean=} resolveToContext Resolve to a context instead of a file
* @property {boolean=} resolveToContext Resolve to a context instead of a file
* @property {(string|RegExp)[]=} restrictions A list of resolve restrictions
* @property {(string|RegExp)[]=} restrictions A list of resolve restrictions
* @property {boolean=} useSyncFileSystemCalls Use only the sync const
ia
nts of the file system calls
* @property {boolean=} useSyncFileSystemCalls Use only the sync const
rai
nts of the file system calls
* @property {boolean=} preferRelative Prefer to resolve module requests as relative requests before falling back to modules
* @property {boolean=} preferRelative Prefer to resolve module requests as relative requests before falling back to modules
* @property {boolean=} preferAbsolute Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
* @property {boolean=} preferAbsolute Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
*/
*/
...
@@ -136583,7 +136942,7 @@ exports.createResolver = function (options) {
...
@@ -136583,7 +136942,7 @@ exports.createResolver = function (options) {
resolver.ensureHook("resolve");
resolver.ensureHook("resolve");
resolver.ensureHook("internalResolve");
resolver.ensureHook("internalResolve");
resolver.ensureHook("newInteralResolve");
resolver.ensureHook("newInter
n
alResolve");
resolver.ensureHook("parsedResolve");
resolver.ensureHook("parsedResolve");
resolver.ensureHook("describedResolve");
resolver.ensureHook("describedResolve");
resolver.ensureHook("internal");
resolver.ensureHook("internal");
...
@@ -136605,6 +136964,11 @@ exports.createResolver = function (options) {
...
@@ -136605,6 +136964,11 @@ exports.createResolver = function (options) {
resolver.ensureHook("existingFile");
resolver.ensureHook("existingFile");
resolver.ensureHook("resolved");
resolver.ensureHook("resolved");
// TODO remove in next major
// cspell:word Interal
// Backward-compat
resolver.hooks.newInteralResolve = resolver.hooks.newInternalResolve;
// resolve
// resolve
for (const { source, resolveOptions } of [
for (const { source, resolveOptions } of [
{ source: "resolve", resolveOptions: { fullySpecified } },
{ source: "resolve", resolveOptions: { fullySpecified } },
...
@@ -136709,7 +137073,7 @@ exports.createResolver = function (options) {
...
@@ -136709,7 +137073,7 @@ exports.createResolver = function (options) {
if (Array.isArray(item)) {
if (Array.isArray(item)) {
if (item.includes("node_modules") && pnpApi) {
if (item.includes("node_modules") && pnpApi) {
plugins.push(
plugins.push(
new ModulesInHiera
chic
DirectoriesPlugin(
new ModulesInHiera
rchical
DirectoriesPlugin(
"raw-module",
"raw-module",
item.filter(i => i !== "node_modules"),
item.filter(i => i !== "node_modules"),
"module"
"module"
...
@@ -136720,7 +137084,11 @@ exports.createResolver = function (options) {
...
@@ -136720,7 +137084,11 @@ exports.createResolver = function (options) {
);
);
} else {
} else {
plugins.push(
plugins.push(
new ModulesInHierachicDirectoriesPlugin("raw-module", item, "module")
new ModulesInHierarchicalDirectoriesPlugin(
"raw-module",
item,
"module"
)
);
);
}
}
} else {
} else {
...
@@ -137065,7 +137433,12 @@ module.exports = class ResultPlugin {
...
@@ -137065,7 +137433,12 @@ module.exports = class ResultPlugin {
resolverContext.log("reporting result " + obj.path);
resolverContext.log("reporting result " + obj.path);
resolver.hooks.result.callAsync(obj, resolverContext, err => {
resolver.hooks.result.callAsync(obj, resolverContext, err => {
if (err) return callback(err);
if (err) return callback(err);
callback(null, obj);
if (typeof resolverContext.yield === "function") {
resolverContext.yield(obj);
callback(null, null);
} else {
callback(null, obj);
}
});
});
}
}
);
);
...
@@ -137273,7 +137646,7 @@ module.exports = class SymlinkPlugin {
...
@@ -137273,7 +137646,7 @@ module.exports = class SymlinkPlugin {
.tapAsync("SymlinkPlugin", (request, resolveContext, callback) => {
.tapAsync("SymlinkPlugin", (request, resolveContext, callback) => {
if (request.ignoreSymlinks) return callback();
if (request.ignoreSymlinks) return callback();
const pathsResult = getPaths(request.path);
const pathsResult = getPaths(request.path);
const pathSe
qments = pathsResult.seq
ments;
const pathSe
gments = pathsResult.seg
ments;
const paths = pathsResult.paths;
const paths = pathsResult.paths;
let containsSymlink = false;
let containsSymlink = false;
...
@@ -137286,7 +137659,7 @@ module.exports = class SymlinkPlugin {
...
@@ -137286,7 +137659,7 @@ module.exports = class SymlinkPlugin {
resolveContext.fileDependencies.add(path);
resolveContext.fileDependencies.add(path);
fs.readlink(path, (err, result) => {
fs.readlink(path, (err, result) => {
if (!err && result) {
if (!err && result) {
pathSe
q
ments[idx] = result;
pathSe
g
ments[idx] = result;
containsSymlink = true;
containsSymlink = true;
// Shortcut when absolute symlink found
// Shortcut when absolute symlink found
const resultType = getType(result.toString());
const resultType = getType(result.toString());
...
@@ -137302,11 +137675,11 @@ module.exports = class SymlinkPlugin {
...
@@ -137302,11 +137675,11 @@ module.exports = class SymlinkPlugin {
},
},
(err, idx) => {
(err, idx) => {
if (!containsSymlink) return callback();
if (!containsSymlink) return callback();
const resultSe
q
ments =
const resultSe
g
ments =
typeof idx === "number"
typeof idx === "number"
? pathSe
q
ments.slice(0, idx + 1)
? pathSe
g
ments.slice(0, idx + 1)
: pathSe
q
ments.slice();
: pathSe
g
ments.slice();
const result = resultSe
q
ments.reduceRight((a, b) => {
const result = resultSe
g
ments.reduceRight((a, b) => {
return resolver.join(a, b);
return resolver.join(a, b);
});
});
const obj = {
const obj = {
...
@@ -137646,6 +138019,7 @@ module.exports = function createInnerContext(
...
@@ -137646,6 +138019,7 @@ module.exports = function createInnerContext(
}
}
const childContext = {
const childContext = {
log: innerLog,
log: innerLog,
yield: options.yield,
fileDependencies: options.fileDependencies,
fileDependencies: options.fileDependencies,
contextDependencies: options.contextDependencies,
contextDependencies: options.contextDependencies,
missingDependencies: options.missingDependencies,
missingDependencies: options.missingDependencies,
...
@@ -137737,23 +138111,24 @@ module.exports = function getInnerRequest(resolver, request) {
...
@@ -137737,23 +138111,24 @@ module.exports = function getInnerRequest(resolver, request) {
module.exports = function getPaths(path) {
module.exports = function getPaths(path) {
if (path === "/") return { paths: ["/"], segments: [""] };
const parts = path.split(/(.*?[\\/]+)/);
const parts = path.split(/(.*?[\\/]+)/);
const paths = [path];
const paths = [path];
const se
q
ments = [parts[parts.length - 1]];
const se
g
ments = [parts[parts.length - 1]];
let part = parts[parts.length - 1];
let part = parts[parts.length - 1];
path = path.substr(0, path.length - part.length - 1);
path = path.substr(0, path.length - part.length - 1);
for (let i = parts.length - 2; i > 2; i -= 2) {
for (let i = parts.length - 2; i > 2; i -= 2) {
paths.push(path);
paths.push(path);
part = parts[i];
part = parts[i];
path = path.substr(0, path.length - part.length) || "/";
path = path.substr(0, path.length - part.length) || "/";
se
q
ments.push(part.substr(0, part.length - 1));
se
g
ments.push(part.substr(0, part.length - 1));
}
}
part = parts[1];
part = parts[1];
se
q
ments.push(part);
se
g
ments.push(part);
paths.push(part);
paths.push(part);
return {
return {
paths: paths,
paths: paths,
se
qments: seq
ments
se
gments: seg
ments
};
};
};
};
...
@@ -141590,7 +141965,7 @@ module.exports = JSON.parse('{"application/1d-interleaved-parityfec":{"source":"
...
@@ -141590,7 +141965,7 @@ module.exports = JSON.parse('{"application/1d-interleaved-parityfec":{"source":"
/***/ (function(module) {
/***/ (function(module) {
"use strict";
"use strict";
module.exports = {"i8":"5.6
8
.0"};
module.exports = {"i8":"5.6
9
.0"};
/***/ }),
/***/ }),
packages/next/package.json
View file @
54dbeb30
...
@@ -267,7 +267,7 @@
...
@@ -267,7 +267,7 @@
"webpack-sources1"
:
"npm:webpack-sources@1.4.3"
,
"webpack-sources1"
:
"npm:webpack-sources@1.4.3"
,
"webpack-sources3"
:
"npm:webpack-sources@3.2.3"
,
"webpack-sources3"
:
"npm:webpack-sources@3.2.3"
,
"webpack4"
:
"npm:webpack@4.44.1"
,
"webpack4"
:
"npm:webpack@4.44.1"
,
"webpack5"
:
"npm:webpack@5.6
8
.0"
,
"webpack5"
:
"npm:webpack@5.6
9
.0"
,
"ws"
:
"8.2.3"
"ws"
:
"8.2.3"
},
},
"resolutions"
:
{
"resolutions"
:
{
...
...
yarn.lock
View file @
54dbeb30
...
@@ -4501,10 +4501,10 @@
...
@@ -4501,10 +4501,10 @@
version "4.1.5"
version "4.1.5"
resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd"
resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd"
"@types/eslint-scope@^3.7.
0
":
"@types/eslint-scope@^3.7.
3
":
version "3.7.
0
"
version "3.7.
3
"
resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.
0.tgz#4792816e31119ebd506902a482caec4951fabd86
"
resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.
3.tgz#125b88504b61e3c8bc6f870882003253005c3224
"
integrity sha512-
O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw
==
integrity sha512-
PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g
==
dependencies:
dependencies:
"@types/eslint" "*"
"@types/eslint" "*"
"@types/estree" "*"
"@types/estree" "*"
...
@@ -4526,10 +4526,10 @@
...
@@ -4526,10 +4526,10 @@
version "0.0.39"
version "0.0.39"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
"@types/estree@^0.0.5
0
":
"@types/estree@^0.0.5
1
":
version "0.0.5
0
"
version "0.0.5
1
"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.5
0.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83
"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.5
1.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40
"
integrity sha512-C
6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw
==
integrity sha512-C
uPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ
==
"@types/etag@1.8.0":
"@types/etag@1.8.0":
version "1.8.0"
version "1.8.0"
...
@@ -8878,10 +8878,10 @@ enhanced-resolve@^4.3.0:
...
@@ -8878,10 +8878,10 @@ enhanced-resolve@^4.3.0:
memory-fs "^0.5.0"
memory-fs "^0.5.0"
tapable "^1.0.0"
tapable "^1.0.0"
enhanced-resolve@^5.
8.3
:
enhanced-resolve@^5.
9.0
:
version "5.
8.3
"
version "5.
9.0
"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.
8.3.tgz#6d552d465cce0423f5b3d718511ea53826a7b2f0
"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.
9.0.tgz#49ac24953ac8452ed8fed2ef1340fc8e043667ee
"
integrity sha512-
EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZ
A==
integrity sha512-
weDYmzbBygL7HzGGS26M3hGQx68vehdEg6VUmqSOaFzXExFqlnKuSvsEJCVGQHScS8CQMbrAqftT+AzzHNt/Y
A==
dependencies:
dependencies:
graceful-fs "^4.2.4"
graceful-fs "^4.2.4"
tapable "^2.2.0"
tapable "^2.2.0"
...
@@ -20847,13 +20847,13 @@ webpack-bundle-analyzer@4.3.0:
...
@@ -20847,13 +20847,13 @@ webpack-bundle-analyzer@4.3.0:
watchpack "^1.7.4"
watchpack "^1.7.4"
webpack-sources "^1.4.1"
webpack-sources "^1.4.1"
"webpack5@npm:webpack@5.6
8
.0":
"webpack5@npm:webpack@5.6
9
.0":
version "5.6
8
.0"
version "5.6
9
.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.6
8.0.tgz#a653a58ed44280062e47257f260117e4be90d560
"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.6
9.0.tgz#c9eb607d4f6c49f1e5755492323a7b055c3450e3
"
integrity sha512-
zUcqaUO0772UuuW2bzaES2Zjlm/y3kRBQDVFVCge+s2Y8mwuUTdperGaAv65/NtRL/1zanpSJOq/MD8u61vo6
g==
integrity sha512-
E5Fqu89Gu8fR6vejRqu26h8ld/k6/dCVbeGUcuZjc+goQHDfCPU9rER71JmdtBYGmci7Ec2aFEATQ2IVXKy2w
g==
dependencies:
dependencies:
"@types/eslint-scope" "^3.7.
0
"
"@types/eslint-scope" "^3.7.
3
"
"@types/estree" "^0.0.5
0
"
"@types/estree" "^0.0.5
1
"
"@webassemblyjs/ast" "1.11.1"
"@webassemblyjs/ast" "1.11.1"
"@webassemblyjs/wasm-edit" "1.11.1"
"@webassemblyjs/wasm-edit" "1.11.1"
"@webassemblyjs/wasm-parser" "1.11.1"
"@webassemblyjs/wasm-parser" "1.11.1"
...
@@ -20861,7 +20861,7 @@ webpack-bundle-analyzer@4.3.0:
...
@@ -20861,7 +20861,7 @@ webpack-bundle-analyzer@4.3.0:
acorn-import-assertions "^1.7.6"
acorn-import-assertions "^1.7.6"
browserslist "^4.14.5"
browserslist "^4.14.5"
chrome-trace-event "^1.0.2"
chrome-trace-event "^1.0.2"
enhanced-resolve "^5.
8.3
"
enhanced-resolve "^5.
9.0
"
es-module-lexer "^0.9.0"
es-module-lexer "^0.9.0"
eslint-scope "5.1.1"
eslint-scope "5.1.1"
events "^3.2.0"
events "^3.2.0"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment