/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
esm
/
build
/
webpack
/
plugins
/
/opt/canhelp/node_modules/next/dist/esm/build/webpack/plugins
mkdir
upload
Name
Size
Mode
Actions
minify-webpack-plugin/
-
0755
rm
next-types-plugin/
-
0755
rm
telemetry-plugin/
-
0755
rm
wellknown-errors-plugin/
-
0755
rm
app-build-manifest-plugin.js
1851
0644
edit
dl
rm
app-build-manifest-plugin.js.map
3696
0644
edit
dl
rm
build-manifest-plugin.js
11784
0644
edit
dl
rm
build-manifest-plugin.js.map
20620
0644
edit
dl
rm
copy-file-plugin.js
1998
0644
edit
dl
rm
copy-file-plugin.js.map
3910
0644
edit
dl
rm
css-chunking-plugin.js
13962
0644
edit
dl
rm
css-chunking-plugin.js.map
20144
0644
edit
dl
rm
css-minimizer-plugin.js
3621
0644
edit
dl
rm
css-minimizer-plugin.js.map
6668
0644
edit
dl
rm
devtools-ignore-list-plugin.js
3155
0644
edit
dl
rm
devtools-ignore-list-plugin.js.map
5703
0644
edit
dl
rm
eval-source-map-dev-tool-plugin.js
9951
0644
edit
dl
rm
eval-source-map-dev-tool-plugin.js.map
17814
0644
edit
dl
rm
flight-client-entry-plugin.js
39879
0644
edit
dl
rm
flight-client-entry-plugin.js.map
65962
0644
edit
dl
rm
flight-manifest-plugin.js
21393
0644
edit
dl
rm
flight-manifest-plugin.js.map
33656
0644
edit
dl
rm
jsconfig-paths-plugin.js
7520
0644
edit
dl
rm
jsconfig-paths-plugin.js.map
14188
0644
edit
dl
rm
memory-with-gc-cache-plugin.js
4467
0644
edit
dl
rm
memory-with-gc-cache-plugin.js.map
6975
0644
edit
dl
rm
middleware-plugin.js
28463
0644
edit
dl
rm
middleware-plugin.js.map
49657
0644
edit
dl
rm
mini-css-extract-plugin.js
350
0644
edit
dl
rm
mini-css-extract-plugin.js.map
559
0644
edit
dl
rm
next-drop-client-page-plugin.js
3135
0644
edit
dl
rm
next-drop-client-page-plugin.js.map
5226
0644
edit
dl
rm
next-font-manifest-plugin.js
7218
0644
edit
dl
rm
next-font-manifest-plugin.js.map
10922
0644
edit
dl
rm
next-trace-entrypoints-plugin.js
28571
0644
edit
dl
rm
next-trace-entrypoints-plugin.js.map
45925
0644
edit
dl
rm
nextjs-require-cache-hot-reloader.js
1817
0644
edit
dl
rm
nextjs-require-cache-hot-reloader.js.map
3460
0644
edit
dl
rm
optional-peer-dependency-resolve-plugin.js
1861
0644
edit
dl
rm
optional-peer-dependency-resolve-plugin.js.map
3023
0644
edit
dl
rm
pages-manifest-plugin.js
4720
0644
edit
dl
rm
pages-manifest-plugin.js.map
9182
0644
edit
dl
rm
profiling-plugin.js
12742
0644
edit
dl
rm
profiling-plugin.js.map
22329
0644
edit
dl
rm
react-loadable-plugin.js
7873
0644
edit
dl
rm
react-loadable-plugin.js.map
13557
0644
edit
dl
rm
rspack-flight-client-entry-plugin.js
4029
0644
edit
dl
rm
rspack-flight-client-entry-plugin.js.map
8008
0644
edit
dl
rm
rspack-profiling-plugin.js
2436
0644
edit
dl
rm
rspack-profiling-plugin.js.map
3828
0644
edit
dl
rm
slow-module-detection-plugin.js
8330
0644
edit
dl
rm
slow-module-detection-plugin.js.map
13734
0644
edit
dl
rm
subresource-integrity-plugin.js
2238
0644
edit
dl
rm
subresource-integrity-plugin.js.map
4380
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/esm/build/webpack/plugins/pages-manifest-plugin.js
(4720B)
import path from 'path'; import fs from 'fs/promises'; import { webpack, sources } from 'next/dist/compiled/webpack/webpack'; import { PAGES_MANIFEST, APP_PATHS_MANIFEST } from '../../../shared/lib/constants'; import getRouteFromEntrypoint from '../../../server/get-route-from-entrypoint'; import { normalizePathSep } from '../../../shared/lib/page-path/normalize-path-sep'; export let edgeServerPages = {}; export let nodeServerPages = {}; export let edgeServerAppPaths = {}; export let nodeServerAppPaths = {}; // This plugin creates a pages-manifest.json from page entrypoints. // This is used for mapping paths like `/` to `.next/server/static/<buildid>/pages/index.js` when doing SSR // It's also used by next export to provide defaultPathMap export default class PagesManifestPlugin { constructor({ dev, distDir, isEdgeRuntime, appDirEnabled }){ this.dev = dev; this.distDir = distDir; this.isEdgeRuntime = isEdgeRuntime; this.appDirEnabled = appDirEnabled; } async createAssets(compilation) { const entrypoints = compilation.entrypoints; const pages = {}; const appPaths = {}; for (const entrypoint of entrypoints.values()){ const pagePath = getRouteFromEntrypoint(entrypoint.name, this.appDirEnabled); if (!pagePath) { continue; } const files = entrypoint.getFiles().filter((file)=>!file.includes('webpack-runtime') && !file.includes('webpack-api-runtime') && file.endsWith('.js')); // Skip entries which are empty if (!files.length) { continue; } // Write filename, replace any backslashes in path (on windows) with forwardslashes for cross-platform consistency. let file = files[files.length - 1]; if (!this.dev) { if (!this.isEdgeRuntime) { file = file.slice(3); } } file = normalizePathSep(file); if (entrypoint.name.startsWith('app/')) { appPaths[pagePath] = file; } else { pages[pagePath] = file; } } // This plugin is used by both the Node server and Edge server compilers, // we need to merge both pages to generate the full manifest. if (this.isEdgeRuntime) { edgeServerPages = pages; edgeServerAppPaths = appPaths; } else { nodeServerPages = pages; nodeServerAppPaths = appPaths; } // handle parallel compilers writing to the same // manifest path by merging existing manifest with new const writeMergedManifest = async (manifestPath, entries)=>{ await fs.mkdir(path.dirname(manifestPath), { recursive: true }); await fs.writeFile(manifestPath, JSON.stringify({ ...await fs.readFile(manifestPath, 'utf8').then((res)=>JSON.parse(res)).catch(()=>({})), ...entries }, null, 2)); }; if (this.distDir) { const pagesManifestPath = path.join(this.distDir, 'server', PAGES_MANIFEST); await writeMergedManifest(pagesManifestPath, { ...edgeServerPages, ...nodeServerPages }); } else { const pagesManifestPath = (!this.dev && !this.isEdgeRuntime ? '../' : '') + PAGES_MANIFEST; compilation.emitAsset(pagesManifestPath, new sources.RawSource(JSON.stringify({ ...edgeServerPages, ...nodeServerPages }, null, 2))); } if (this.appDirEnabled) { if (this.distDir) { const appPathsManifestPath = path.join(this.distDir, 'server', APP_PATHS_MANIFEST); await writeMergedManifest(appPathsManifestPath, { ...edgeServerAppPaths, ...nodeServerAppPaths }); } else { compilation.emitAsset((!this.dev && !this.isEdgeRuntime ? '../' : '') + APP_PATHS_MANIFEST, new sources.RawSource(JSON.stringify({ ...edgeServerAppPaths, ...nodeServerAppPaths }, null, 2))); } } } apply(compiler) { compiler.hooks.make.tap('NextJsPagesManifest', (compilation)=>{ compilation.hooks.processAssets.tapPromise({ name: 'NextJsPagesManifest', stage: webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS }, ()=>this.createAssets(compilation)); }); } } //# sourceMappingURL=pages-manifest-plugin.js.map
Save
cmd:
run