/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-metadata-image-loader.js (6313B)
/* * This loader is responsible for extracting the metadata image info for rendering in html */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { default: null, raw: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { default: function() { return _default; }, raw: function() { return raw; } }); const _fs = require("fs"); const _path = /*#__PURE__*/ _interop_require_default(require("path")); const _loaderutils3 = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/loader-utils3")); const _imageoptimizer = require("../../../server/image-optimizer"); const _mimetype = require("../../../lib/mime-type"); const _constants = require("../../../lib/constants"); const _normalizepathsep = require("../../../shared/lib/page-path/normalize-path-sep"); const _utils = require("./utils"); function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // [NOTE] For turbopack, refer to app_page_loader_tree's write_metadata_item for // corresponding features. async function nextMetadataImageLoader(content) { const options = this.getOptions(); const { type, segment, pageExtensions, basePath } = options; const { resourcePath, rootContext: context } = this; const { name: fileNameBase, ext } = _path.default.parse(resourcePath); const useNumericSizes = type === 'twitter' || type === 'openGraph'; let extension = ext.slice(1); if (extension === 'jpg') { extension = 'jpeg'; } const opts = { context, content }; // No hash query for favicon.ico const contentHash = type === 'favicon' ? '' : _loaderutils3.default.interpolateName(this, '[contenthash]', opts); const interpolatedName = _loaderutils3.default.interpolateName(this, '[name].[ext]', opts); const isDynamicResource = pageExtensions.includes(extension); const pageSegment = isDynamicResource ? fileNameBase : interpolatedName; const hashQuery = contentHash ? '?' + contentHash : ''; const pathnamePrefix = (0, _normalizepathsep.normalizePathSep)(_path.default.join(basePath, segment)); if (isDynamicResource) { const exportedFieldsExcludingDefault = (await (0, _utils.getLoaderModuleNamedExports)(resourcePath, this)).filter((name)=>name !== 'default'); // re-export and spread as `exportedImageData` to avoid non-exported error return `\ import { ${exportedFieldsExcludingDefault.map((field)=>`${field} as _${field}`).join(',')} } from ${JSON.stringify(// This is an arbitrary resource query to ensure it's a new request, instead // of sharing the same module with next-metadata-route-loader. // Since here we only need export fields such as `size`, `alt` and // `generateImageMetadata`, avoid sharing the same module can make this entry // smaller. resourcePath + '?' + _constants.WEBPACK_RESOURCE_QUERIES.metadataImageMeta)} import { fillMetadataSegment } from 'next/dist/lib/metadata/get-metadata-route' const imageModule = { ${exportedFieldsExcludingDefault.map((field)=>`${field}: _${field}`).join(',')} } export default async function (props) { const { __metadata_id__: _, ...params } = await props.params const imageUrl = fillMetadataSegment(${JSON.stringify(pathnamePrefix)}, params, ${JSON.stringify(pageSegment)}) const { generateImageMetadata } = imageModule function getImageMetadata(imageMetadata, idParam) { const data = { alt: imageMetadata.alt, type: imageMetadata.contentType || 'image/png', url: imageUrl + (idParam ? ('/' + idParam) : '') + ${JSON.stringify(hashQuery)}, } const { size } = imageMetadata if (size) { ${type === 'twitter' || type === 'openGraph' ? 'data.width = size.width; data.height = size.height;' : 'data.sizes = size.width + "x" + size.height;'} } return data } if (generateImageMetadata) { const imageMetadataArray = await generateImageMetadata({ params }) return imageMetadataArray.map((imageMetadata, index) => { const idParam = (imageMetadata.id || index) + '' return getImageMetadata(imageMetadata, idParam) }) } else { return [getImageMetadata(imageModule, '')] } }`; } const imageSize = await (0, _imageoptimizer.getImageSize)(content).catch((err)=>err); if (imageSize instanceof Error) { const err = imageSize; err.name = 'InvalidImageFormatError'; throw err; } const imageData = { ...extension in _mimetype.imageExtMimeTypeMap && { type: _mimetype.imageExtMimeTypeMap[extension] }, ...useNumericSizes && imageSize.width != null && imageSize.height != null ? imageSize : { sizes: // For SVGs, skip sizes and use "any" to let it scale automatically based on viewport, // For the images doesn't provide the size properly, use "any" as well. // If the size is presented, use the actual size for the image. extension !== 'svg' && imageSize.width != null && imageSize.height != null ? `${imageSize.width}x${imageSize.height}` : 'any' } }; if (type === 'openGraph' || type === 'twitter') { const altPath = _path.default.join(_path.default.dirname(resourcePath), fileNameBase + '.alt.txt'); if ((0, _fs.existsSync)(altPath)) { imageData.alt = await _fs.promises.readFile(altPath, 'utf8'); } } return `\ import { fillMetadataSegment } from 'next/dist/lib/metadata/get-metadata-route' export default async (props) => { const imageData = ${JSON.stringify(imageData)} const imageUrl = fillMetadataSegment(${JSON.stringify(pathnamePrefix)}, await props.params, ${JSON.stringify(pageSegment)}) return [{ ...imageData, url: imageUrl + ${JSON.stringify(type === 'favicon' ? '' : hashQuery)}, }] }`; } const raw = true; const _default = nextMetadataImageLoader; //# sourceMappingURL=next-metadata-image-loader.js.map