-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
214 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
diff --git a/node_modules/next/dist/server/lib/find-page-file.js b/node_modules/next/dist/server/lib/find-page-file.js | ||
index c293a00..59e04f8 100644 | ||
--- a/node_modules/next/dist/server/lib/find-page-file.js | ||
+++ b/node_modules/next/dist/server/lib/find-page-file.js | ||
@@ -1,2 +1,2 @@ | ||
-"use strict";exports.__esModule=true;exports.findPageFile=findPageFile;var _path=require("path");var _chalk=_interopRequireDefault(require("chalk"));var _isWriteable=require("../../build/is-writeable");var _log=require("../../build/output/log");var _fs=require("fs");var _normalizePagePath=require("../../next-server/server/normalize-page-path");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}async function isTrueCasePagePath(pagePath,pagesDir){const pageSegments=(0,_path.normalize)(pagePath).split(_path.sep).filter(Boolean);const segmentExistsPromises=pageSegments.map(async(segment,i)=>{const segmentParentDir=(0,_path.join)(pagesDir,...pageSegments.slice(0,i));const parentDirEntries=await _fs.promises.readdir(segmentParentDir);return parentDirEntries.includes(segment);});return(await Promise.all(segmentExistsPromises)).every(Boolean);}async function findPageFile(rootDir,normalizedPagePath,pageExtensions){const foundPagePaths=[];const page=(0,_normalizePagePath.denormalizePagePath)(normalizedPagePath);for(const extension of pageExtensions){if(!normalizedPagePath.endsWith('/index')){const relativePagePath=`${page}.${extension}`;const pagePath=(0,_path.join)(rootDir,relativePagePath);if(await(0,_isWriteable.isWriteable)(pagePath)){foundPagePaths.push(relativePagePath);}}const relativePagePathWithIndex=(0,_path.join)(page,`index.${extension}`);const pagePathWithIndex=(0,_path.join)(rootDir,relativePagePathWithIndex);if(await(0,_isWriteable.isWriteable)(pagePathWithIndex)){foundPagePaths.push(relativePagePathWithIndex);}}if(foundPagePaths.length<1){return null;}if(!(await isTrueCasePagePath(foundPagePaths[0],rootDir))){return null;}if(foundPagePaths.length>1){(0,_log.warn)(`Duplicate page detected. ${_chalk.default.cyan((0,_path.join)('pages',foundPagePaths[0]))} and ${_chalk.default.cyan((0,_path.join)('pages',foundPagePaths[1]))} both resolve to ${_chalk.default.cyan(normalizedPagePath)}.`);}return foundPagePaths[0];} | ||
+"use strict";exports.__esModule=true;exports.findPageFile=findPageFile;var _path=require("path");var _chalk=_interopRequireDefault(require("chalk"));var _isWriteable=require("../../build/is-writeable");var _log=require("../../build/output/log");var _fs=require("fs");var _normalizePagePath=require("../../next-server/server/normalize-page-path");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}async function isTrueCasePagePath(pagePath,pagesDir){const pageSegments=(0,_path.normalize)(pagePath).split(_path.sep).filter(Boolean);const segmentExistsPromises=pageSegments.map(async(segment,i)=>{const segmentParentDir=(0,_path.join)(pagesDir,...pageSegments.slice(0,i));const parentDirEntries=await _fs.promises.readdir(segmentParentDir);return parentDirEntries.includes(segment);});return(await Promise.all(segmentExistsPromises)).every(Boolean);}async function findPageFile(rootDir,normalizedPagePath,pageExtensions){const foundPagePaths=[];const page=(0,_normalizePagePath.denormalizePagePath)(normalizedPagePath);for(const extension of pageExtensions){if(!normalizedPagePath.endsWith('/index')){const relativePagePath=`${page}.${extension}`;const pagePath=(0,_path.join)(rootDir,relativePagePath);if(true){foundPagePaths.push(relativePagePath);}}const relativePagePathWithIndex=(0,_path.join)(page,`index.${extension}`);const pagePathWithIndex=(0,_path.join)(rootDir,relativePagePathWithIndex);if(true){foundPagePaths.push(relativePagePathWithIndex);}}if(foundPagePaths.length<1){return null;}if(!(await isTrueCasePagePath(foundPagePaths[0],rootDir))){return null;}if(foundPagePaths.length>1){(0,_log.warn)(`Duplicate page detected. ${_chalk.default.cyan((0,_path.join)('pages',foundPagePaths[0]))} and ${_chalk.default.cyan((0,_path.join)('pages',foundPagePaths[1]))} both resolve to ${_chalk.default.cyan(normalizedPagePath)}.`);}return foundPagePaths[0];} | ||
//# sourceMappingURL=find-page-file.js.map | ||
\ No newline at end of file |
Oops, something went wrong.