Skip to content

Commit 3a19357

Browse files
committed
upgrade webpack to 5.51.1
1 parent 1b5d6f4 commit 3a19357

File tree

3 files changed

+55
-23
lines changed

3 files changed

+55
-23
lines changed

packages/next/bundles/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"dependencies": {
33
"schema-utils3": "npm:schema-utils@3.0.0",
44
"webpack-sources3": "npm:webpack-sources@3.2.0",
5-
"webpack5": "npm:webpack@5.51.0"
5+
"webpack5": "npm:webpack@5.51.1"
66
},
77
"resolutions": {
88
"browserslist": "4.16.6",

packages/next/bundles/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,10 @@ watchpack@^2.2.0:
475475
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.0.tgz#b16973bcf844ebcdb3afde32eda1c04d0b90f89d"
476476
integrity sha512-fahN08Et7P9trej8xz/Z7eRu8ltyiygEo/hnRi9KqBUs80KeDcnf96ZJo++ewWd84fEf3xSX9bp4ZS9hbw0OBw==
477477

478-
"webpack5@npm:webpack@5.51.0":
479-
version "5.51.0"
480-
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.51.0.tgz#b6683d92e4bd84db588bacb6ade6441d9c5fd2f3"
481-
integrity sha512-oySQoKUuf5r0JaPIYi8q90c/GmU9fGdSbZ0cAjFq3OWx57wniRTWvta1T9t+e5WZ6H6mHrxksNatkqfIEuTWGg==
478+
"webpack5@npm:webpack@5.51.1":
479+
version "5.51.1"
480+
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.51.1.tgz#41bebf38dccab9a89487b16dbe95c22e147aac57"
481+
integrity sha512-xsn3lwqEKoFvqn4JQggPSRxE4dhsRcysWTqYABAZlmavcoTmwlOb9b1N36Inbt/eIispSkuHa80/FJkDTPos1A==
482482
dependencies:
483483
"@types/eslint-scope" "^3.7.0"
484484
"@types/estree" "^0.0.50"

packages/next/compiled/webpack/bundle5.js

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = JSON.parse("{\"name\":\"terser\",\"description\":\"JavaScript p
5454
/***/ (function(module) {
5555

5656
"use strict";
57-
module.exports = {"i8":"5.51.0"};
57+
module.exports = {"i8":"5.51.1"};
5858

5959
/***/ }),
6060

@@ -53636,7 +53636,7 @@ const NormalModule = __webpack_require__(88376);
5363653636
const SourceMapDevToolModuleOptionsPlugin = __webpack_require__(5426);
5363753637
const JavascriptModulesPlugin = __webpack_require__(80867);
5363853638
const ConcatenatedModule = __webpack_require__(74233);
53639-
const { absolutify } = __webpack_require__(47779);
53639+
const { makePathsAbsolute } = __webpack_require__(47779);
5364053640

5364153641
/** @typedef {import("webpack-sources").Source} Source */
5364253642
/** @typedef {import("../declarations/WebpackOptions").DevTool} DevToolOptions */
@@ -53750,7 +53750,7 @@ class EvalSourceMapDevToolPlugin {
5375053750
const root = compiler.root;
5375153751
const modules = sourceMap.sources.map(source => {
5375253752
if (!source.startsWith("webpack://")) return source;
53753-
source = absolutify(context, source.slice(10), root);
53753+
source = makePathsAbsolute(context, source.slice(10), root);
5375453754
const module = compilation.findModule(source);
5375553755
return module || source;
5375653756
});
@@ -57253,6 +57253,7 @@ const getManagedItem = (managedPath, path) => {
5725357253
*/
5725457254
const getResolvedTimestamp = entry => {
5725557255
if (entry === "ignore") return undefined;
57256+
if (entry === null) return null;
5725657257
if (entry.resolved !== undefined) return entry.resolved;
5725757258
return entry.symlinks === undefined ? entry : undefined;
5725857259
};
@@ -57262,6 +57263,7 @@ const getResolvedTimestamp = entry => {
5726257263
* @returns {string | undefined} the resolved entry
5726357264
*/
5726457265
const getResolvedHash = entry => {
57266+
if (entry === null) return null;
5726557267
if (entry.resolved !== undefined) return entry.resolved;
5726657268
return entry.symlinks === undefined ? entry.hash : undefined;
5726757269
};
@@ -67616,7 +67618,11 @@ const {
6761667618
} = __webpack_require__(21699);
6761767619
const createHash = __webpack_require__(34627);
6761867620
const { join } = __webpack_require__(71593);
67619-
const { contextify, absolutify } = __webpack_require__(47779);
67621+
const {
67622+
contextify,
67623+
absolutify,
67624+
makePathsRelative
67625+
} = __webpack_require__(47779);
6762067626
const makeSerializable = __webpack_require__(55575);
6762167627
const memoize = __webpack_require__(18003);
6762267628

@@ -67680,7 +67686,11 @@ const ABSOLUTE_PATH_REGEX = /^([a-zA-Z]:\\|\\\\|\/)/;
6768067686
*/
6768167687
const contextifySourceUrl = (context, source, associatedObjectForCache) => {
6768267688
if (source.startsWith("webpack://")) return source;
67683-
return `webpack://${contextify(context, source, associatedObjectForCache)}`;
67689+
return `webpack://${makePathsRelative(
67690+
context,
67691+
source,
67692+
associatedObjectForCache
67693+
)}`;
6768467694
};
6768567695

6768667696
/**
@@ -73764,7 +73774,7 @@ const SourceMapDevToolModuleOptionsPlugin = __webpack_require__(5426);
7376473774
const createSchemaValidation = __webpack_require__(32797);
7376573775
const createHash = __webpack_require__(34627);
7376673776
const { relative, dirname } = __webpack_require__(71593);
73767-
const { absolutify } = __webpack_require__(47779);
73777+
const { makePathsAbsolute } = __webpack_require__(47779);
7376873778

7376973779
/** @typedef {import("webpack-sources").MapOptions} MapOptions */
7377073780
/** @typedef {import("webpack-sources").Source} Source */
@@ -73841,7 +73851,7 @@ const getTaskForFile = (
7384173851
if (!sourceMap || typeof source !== "string") return;
7384273852
const context = compilation.options.context;
7384373853
const root = compilation.compiler.root;
73844-
const cachedAbsolutify = absolutify.bindContextCache(context, root);
73854+
const cachedAbsolutify = makePathsAbsolute.bindContextCache(context, root);
7384573855
const modules = sourceMap.sources.map(source => {
7384673856
if (!source.startsWith("webpack://")) return source;
7384773857
source = cachedAbsolutify(source.slice(10));
@@ -111425,6 +111435,10 @@ class ModuleLibraryPlugin extends AbstractLibraryPlugin {
111425111435
const result = new ConcatSource(source);
111426111436
const exportsInfo = moduleGraph.getExportsInfo(module);
111427111437
const exports = [];
111438+
const isAsync = moduleGraph.isAsync(module);
111439+
if (isAsync) {
111440+
result.add(`__webpack_exports__ = await __webpack_exports__;\n`);
111441+
}
111428111442
for (const exportInfo of exportsInfo.orderedExports) {
111429111443
if (!exportInfo.provided) continue;
111430111444
const varName = `__webpack_exports__${Template.toIdentifier(
@@ -114347,7 +114361,7 @@ const { equals } = __webpack_require__(92459);
114347114361
const LazySet = __webpack_require__(60248);
114348114362
const { concatComparators, keepOriginalOrder } = __webpack_require__(21699);
114349114363
const createHash = __webpack_require__(34627);
114350-
const contextify = __webpack_require__(47779).contextify;
114364+
const { makePathsRelative } = __webpack_require__(47779);
114351114365
const makeSerializable = __webpack_require__(55575);
114352114366
const propertyAccess = __webpack_require__(44682);
114353114367
const {
@@ -115335,13 +115349,13 @@ class ConcatenatedModule extends Module {
115335115349
}
115336115350

115337115351
static _createIdentifier(rootModule, modules, associatedObjectForCache) {
115338-
const cachedContextify = contextify.bindContextCache(
115352+
const cachedMakePathsRelative = makePathsRelative.bindContextCache(
115339115353
rootModule.context,
115340115354
associatedObjectForCache
115341115355
);
115342115356
let identifiers = [];
115343115357
for (const module of modules) {
115344-
identifiers.push(cachedContextify(module.identifier()));
115358+
identifiers.push(cachedMakePathsRelative(module.identifier()));
115345115359
}
115346115360
identifiers.sort();
115347115361
const hash = createHash("md4");
@@ -140356,6 +140370,13 @@ const WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g;
140356140370
* @property {Map<string, Map<string, string>>=} relativePaths
140357140371
*/
140358140372

140373+
const relativePathToRequest = relativePath => {
140374+
if (relativePath === "") return "./.";
140375+
if (relativePath === "..") return "../.";
140376+
if (relativePath.startsWith("../")) return relativePath;
140377+
return `./${relativePath}`;
140378+
};
140379+
140359140380
/**
140360140381
* @param {string} context context for relative path
140361140382
* @param {string} maybeAbsolutePath path to make relative
@@ -140377,10 +140398,7 @@ const absoluteToRequest = (context, maybeAbsolutePath) => {
140377140398
querySplitPos === -1
140378140399
? maybeAbsolutePath
140379140400
: maybeAbsolutePath.slice(0, querySplitPos);
140380-
resource = path.posix.relative(context, resource);
140381-
if (!resource.startsWith("../")) {
140382-
resource = "./" + resource;
140383-
}
140401+
resource = relativePathToRequest(path.posix.relative(context, resource));
140384140402
return querySplitPos === -1
140385140403
? resource
140386140404
: resource + maybeAbsolutePath.slice(querySplitPos);
@@ -140394,10 +140412,9 @@ const absoluteToRequest = (context, maybeAbsolutePath) => {
140394140412
: maybeAbsolutePath.slice(0, querySplitPos);
140395140413
resource = path.win32.relative(context, resource);
140396140414
if (!WINDOWS_ABS_PATH_REGEXP.test(resource)) {
140397-
resource = resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP, "/");
140398-
if (!resource.startsWith("../")) {
140399-
resource = "./" + resource;
140400-
}
140415+
resource = relativePathToRequest(
140416+
resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP, "/")
140417+
);
140401140418
}
140402140419
return querySplitPos === -1
140403140420
? resource
@@ -140555,6 +140572,21 @@ const _makePathsRelative = (context, identifier) => {
140555140572

140556140573
exports.makePathsRelative = makeCacheable(_makePathsRelative);
140557140574

140575+
/**
140576+
*
140577+
* @param {string} context context for relative path
140578+
* @param {string} identifier identifier for path
140579+
* @returns {string} a converted relative path
140580+
*/
140581+
const _makePathsAbsolute = (context, identifier) => {
140582+
return identifier
140583+
.split(SEGMENTS_SPLIT_REGEXP)
140584+
.map(str => requestToAbsolute(context, str))
140585+
.join("");
140586+
};
140587+
140588+
exports.makePathsAbsolute = makeCacheable(_makePathsAbsolute);
140589+
140558140590
/**
140559140591
* @param {string} context absolute context path
140560140592
* @param {string} request any request string may containing absolute paths, query string, etc.

0 commit comments

Comments
 (0)