/opt/canhelp/node_modules/next/dist/build/webpack/loaders
NameSizeModeActions
css-loader/-0755rm
devtool/-0755rm
lightningcss-loader/-0755rm
metadata/-0755rm
next-app-loader/-0755rm
next-edge-app-route-loader/-0755rm
next-edge-ssr-loader/-0755rm
next-flight-loader/-0755rm
next-font-loader/-0755rm
next-image-loader/-0755rm
next-route-loader/-0755rm
next-style-loader/-0755rm
postcss-loader/-0755rm
resolve-url-loader/-0755rm
empty-loader.d.ts1560644editdlrm
empty-loader.js3200644editdlrm
empty-loader.js.map3880644editdlrm
error-loader.d.ts1560644editdlrm
error-loader.js14280644editdlrm
error-loader.js.map16740644editdlrm
get-module-build-info.d.ts14950644editdlrm
get-module-build-info.js3580644editdlrm
get-module-build-info.js.map19370644editdlrm
modularize-import-loader.d.ts6390644editdlrm
modularize-import-loader.js12550644editdlrm
modularize-import-loader.js.map17200644editdlrm
next-barrel-loader.d.ts31400644editdlrm
next-barrel-loader.js103450644editdlrm
next-barrel-loader.js.map155050644editdlrm
next-client-pages-loader.d.ts1860644editdlrm
next-client-pages-loader.js12380644editdlrm
next-client-pages-loader.js.map19060644editdlrm
next-edge-function-loader.d.ts3700644editdlrm
next-edge-function-loader.js19080644editdlrm
next-edge-function-loader.js.map32060644editdlrm
next-error-browser-binary-loader.d.ts1610644editdlrm
next-error-browser-binary-loader.js7140644editdlrm
next-error-browser-binary-loader.js.map9290644editdlrm
next-flight-action-entry-loader.d.ts4760644editdlrm
next-flight-action-entry-loader.js9720644editdlrm
next-flight-action-entry-loader.js.map19550644editdlrm
next-flight-client-entry-loader.d.ts6240644editdlrm
next-flight-client-entry-loader.js19780644editdlrm
next-flight-client-entry-loader.js.map41020644editdlrm
next-flight-client-module-loader.d.ts1820644editdlrm
next-flight-client-module-loader.js22350644editdlrm
next-flight-client-module-loader.js.map34240644editdlrm
next-flight-css-loader.d.ts4200644editdlrm
next-flight-css-loader.js20800644editdlrm
next-flight-css-loader.js.map30600644editdlrm
next-flight-server-reference-proxy-loader.d.ts2370644editdlrm
next-flight-server-reference-proxy-loader.js13340644editdlrm
next-flight-server-reference-proxy-loader.js.map18830644editdlrm
next-invalid-import-error-loader.d.ts2480644editdlrm
next-invalid-import-error-loader.js5680644editdlrm
next-invalid-import-error-loader.js.map7330644editdlrm
next-metadata-image-loader.d.ts5060644editdlrm
next-metadata-image-loader.js63130644editdlrm
next-metadata-image-loader.js.map96980644editdlrm
next-metadata-route-loader.d.ts3980644editdlrm
next-metadata-route-loader.js94230644editdlrm
next-metadata-route-loader.js.map137040644editdlrm
next-middleware-asset-loader.d.ts1150644editdlrm
next-middleware-asset-loader.js13320644editdlrm
next-middleware-asset-loader.js.map15310644editdlrm
next-middleware-loader.d.ts5300644editdlrm
next-middleware-loader.js20220644editdlrm
next-middleware-loader.js.map35720644editdlrm
next-middleware-wasm-loader.d.ts1140644editdlrm
next-middleware-wasm-loader.js12720644editdlrm
next-middleware-wasm-loader.js.map14890644editdlrm
next-root-params-loader.d.ts2780644editdlrm
next-root-params-loader.js66300644editdlrm
next-root-params-loader.js.map85330644editdlrm
next-swc-loader.d.ts8660644editdlrm
next-swc-loader.js110420644editdlrm
next-swc-loader.js.map149970644editdlrm
utils.d.ts5890644editdlrm
utils.js37710644editdlrm
utils.js.map58870644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-root-params-loader.js (6630B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "default", { enumerable: true, get: function() { return _default; } }); const _nodepath = /*#__PURE__*/ _interop_require_wildcard(require("node:path")); const _promises = /*#__PURE__*/ _interop_require_wildcard(require("node:fs/promises")); const _apppaths = require("../../../shared/lib/router/utils/app-paths"); const _ensureleadingslash = require("../../../shared/lib/page-path/ensure-leading-slash"); const _getsegmentparam = require("../../../server/app-render/get-segment-param"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interop_require_wildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = { __proto__: null }; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for(var key in obj){ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } const rootParamsLoader = async function() { const { appDir, pageExtensions } = this.getOptions(); const allRootParams = await collectRootParamsFromFileSystem({ appDir, pageExtensions }); // invalidate the result whenever a file/directory is added/removed inside the app dir or its subdirectories, // because that might mean that a root layout has been moved. this.addContextDependency(appDir); // If there's no root params, there's nothing to generate. if (allRootParams.size === 0) { return 'export {}'; } // Generate a getter for each root param we found. const sortedRootParamNames = Array.from(allRootParams).sort(); const content = [ `import { getRootParam } from 'next/dist/server/request/root-params';`, ...sortedRootParamNames.map((paramName)=>{ return `export function ${paramName}() { return getRootParam('${paramName}'); }`; }) ].join('\n'); return content; }; const _default = rootParamsLoader; async function collectRootParamsFromFileSystem(opts) { return collectRootParams({ appDir: opts.appDir, rootLayoutFilePaths: await findRootLayouts(opts) }); } function collectRootParams({ rootLayoutFilePaths, appDir }) { const allRootParams = new Set(); for (const rootLayoutFilePath of rootLayoutFilePaths){ const params = getParamsFromLayoutFilePath({ appDir, layoutFilePath: rootLayoutFilePath }); for (const param of params){ allRootParams.add(param); } } return allRootParams; } async function findRootLayouts({ appDir, pageExtensions }) { const layoutFilenameRegex = new RegExp(`^layout\\.(?:${pageExtensions.join('|')})$`); async function visit(directory) { let dir; try { dir = await _promises.readdir(directory, { withFileTypes: true }); } catch (err) { // If the directory was removed before we managed to read it, just ignore it. if (err && typeof err === 'object' && 'code' in err && err.code === 'ENOENT') { return []; } throw err; } const subdirectories = []; for (const entry of dir){ if (entry.isDirectory()) { // Directories that start with an underscore are excluded from routing, so we shouldn't look for layouts inside. if (entry.name[0] === '_') { continue; } // Parallel routes cannot occur above a layout, so they can't contain a root layout. if (entry.name[0] === '@') { continue; } const absolutePathname = _nodepath.join(directory, entry.name); subdirectories.push(absolutePathname); } else if (entry.isFile()) { if (layoutFilenameRegex.test(entry.name)) { // We found a root layout, so we're not going to recurse into subdirectories, // meaning that we can skip the rest of the entries. // Note that we don't need to track any of the subdirectories as dependencies -- // changes in the subdirectories will only become relevant if this root layout is (re)moved, // in which case the loader will re-run, traverse deeper (because it no longer stops at this root layout) // and then track those directories as needed. const rootLayoutPath = _nodepath.join(directory, entry.name); return [ rootLayoutPath ]; } } } if (subdirectories.length === 0) { return []; } const subdirectoryRootLayouts = await Promise.all(subdirectories.map((subdirectory)=>visit(subdirectory))); return subdirectoryRootLayouts.flat(1); } return visit(appDir); } function getParamsFromLayoutFilePath({ appDir, layoutFilePath }) { const rootLayoutPath = (0, _apppaths.normalizeAppPath)((0, _ensureleadingslash.ensureLeadingSlash)(_nodepath.dirname(_nodepath.relative(appDir, layoutFilePath)))); const segments = rootLayoutPath.split('/'); const paramNames = []; for (const segment of segments){ const param = (0, _getsegmentparam.getSegmentParam)(segment); if (param !== null) { paramNames.push(param.param); } } return paramNames; } //# sourceMappingURL=next-root-params-loader.js.map