/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
esm
/
build
/
webpack
/
loaders
/
/opt/canhelp/node_modules/next/dist/esm/build/webpack/loaders
mkdir
upload
Name
Size
Mode
Actions
css-loader/
-
0755
rm
devtool/
-
0755
rm
lightningcss-loader/
-
0755
rm
metadata/
-
0755
rm
next-app-loader/
-
0755
rm
next-edge-app-route-loader/
-
0755
rm
next-edge-ssr-loader/
-
0755
rm
next-flight-loader/
-
0755
rm
next-font-loader/
-
0755
rm
next-image-loader/
-
0755
rm
next-route-loader/
-
0755
rm
next-style-loader/
-
0755
rm
postcss-loader/
-
0755
rm
resolve-url-loader/
-
0755
rm
empty-loader.js
114
0644
edit
dl
rm
empty-loader.js.map
374
0644
edit
dl
rm
error-loader.js
1028
0644
edit
dl
rm
error-loader.js.map
1673
0644
edit
dl
rm
get-module-build-info.js
276
0644
edit
dl
rm
get-module-build-info.js.map
1932
0644
edit
dl
rm
modularize-import-loader.js
881
0644
edit
dl
rm
modularize-import-loader.js.map
1703
0644
edit
dl
rm
next-barrel-loader.js
9964
0644
edit
dl
rm
next-barrel-loader.js.map
15507
0644
edit
dl
rm
next-client-pages-loader.js
1007
0644
edit
dl
rm
next-client-pages-loader.js.map
1904
0644
edit
dl
rm
next-edge-function-loader.js
1650
0644
edit
dl
rm
next-edge-function-loader.js.map
3216
0644
edit
dl
rm
next-error-browser-binary-loader.js
505
0644
edit
dl
rm
next-error-browser-binary-loader.js.map
913
0644
edit
dl
rm
next-flight-action-entry-loader.js
766
0644
edit
dl
rm
next-flight-action-entry-loader.js.map
1941
0644
edit
dl
rm
next-flight-client-entry-loader.js
1760
0644
edit
dl
rm
next-flight-client-entry-loader.js.map
4145
0644
edit
dl
rm
next-flight-client-module-loader.js
1982
0644
edit
dl
rm
next-flight-client-module-loader.js.map
3436
0644
edit
dl
rm
next-flight-css-loader.js
1705
0644
edit
dl
rm
next-flight-css-loader.js.map
3052
0644
edit
dl
rm
next-flight-server-reference-proxy-loader.js
1128
0644
edit
dl
rm
next-flight-server-reference-proxy-loader.js.map
1869
0644
edit
dl
rm
next-invalid-import-error-loader.js
362
0644
edit
dl
rm
next-invalid-import-error-loader.js.map
721
0644
edit
dl
rm
next-metadata-image-loader.js
5582
0644
edit
dl
rm
next-metadata-image-loader.js.map
9774
0644
edit
dl
rm
next-metadata-route-loader.js
8714
0644
edit
dl
rm
next-metadata-route-loader.js.map
13696
0644
edit
dl
rm
next-middleware-asset-loader.js
718
0644
edit
dl
rm
next-middleware-asset-loader.js.map
1515
0644
edit
dl
rm
next-middleware-loader.js
1560
0644
edit
dl
rm
next-middleware-loader.js.map
3585
0644
edit
dl
rm
next-middleware-wasm-loader.js
661
0644
edit
dl
rm
next-middleware-wasm-loader.js.map
1468
0644
edit
dl
rm
next-root-params-loader.js
4862
0644
edit
dl
rm
next-root-params-loader.js.map
8558
0644
edit
dl
rm
next-swc-loader.js
9073
0644
edit
dl
rm
next-swc-loader.js.map
15038
0644
edit
dl
rm
utils.js
2963
0644
edit
dl
rm
utils.js.map
5821
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/esm/build/webpack/loaders/next-metadata-image-loader.js
(5582B)
/* * This loader is responsible for extracting the metadata image info for rendering in html */ import { existsSync, promises as fs } from 'fs'; import path from 'path'; import loaderUtils from 'next/dist/compiled/loader-utils3'; import { getImageSize } from '../../../server/image-optimizer'; import { imageExtMimeTypeMap } from '../../../lib/mime-type'; import { WEBPACK_RESOURCE_QUERIES } from '../../../lib/constants'; import { normalizePathSep } from '../../../shared/lib/page-path/normalize-path-sep'; import { getLoaderModuleNamedExports } from './utils'; // [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.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' ? '' : loaderUtils.interpolateName(this, '[contenthash]', opts); const interpolatedName = loaderUtils.interpolateName(this, '[name].[ext]', opts); const isDynamicResource = pageExtensions.includes(extension); const pageSegment = isDynamicResource ? fileNameBase : interpolatedName; const hashQuery = contentHash ? '?' + contentHash : ''; const pathnamePrefix = normalizePathSep(path.join(basePath, segment)); if (isDynamicResource) { const exportedFieldsExcludingDefault = (await 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 + '?' + 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 getImageSize(content).catch((err)=>err); if (imageSize instanceof Error) { const err = imageSize; err.name = 'InvalidImageFormatError'; throw err; } const imageData = { ...extension in imageExtMimeTypeMap && { type: 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.join(path.dirname(resourcePath), fileNameBase + '.alt.txt'); if (existsSync(altPath)) { imageData.alt = await fs.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)}, }] }`; } export const raw = true; export default nextMetadataImageLoader; //# sourceMappingURL=next-metadata-image-loader.js.map
Save
cmd:
run