/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
build
/
webpack
/
plugins
/
/opt/canhelp/node_modules/next/dist/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.d.ts
288
0644
edit
dl
rm
app-build-manifest-plugin.js
2285
0644
edit
dl
rm
app-build-manifest-plugin.js.map
3649
0644
edit
dl
rm
build-manifest-plugin.d.ts
1880
0644
edit
dl
rm
build-manifest-plugin.js
12769
0644
edit
dl
rm
build-manifest-plugin.js.map
20566
0644
edit
dl
rm
copy-file-plugin.d.ts
415
0644
edit
dl
rm
copy-file-plugin.js
2390
0644
edit
dl
rm
copy-file-plugin.js.map
3855
0644
edit
dl
rm
css-chunking-plugin.d.ts
175
0644
edit
dl
rm
css-chunking-plugin.js
14178
0644
edit
dl
rm
css-chunking-plugin.js.map
20162
0644
edit
dl
rm
css-minimizer-plugin.d.ts
574
0644
edit
dl
rm
css-minimizer-plugin.js
4170
0644
edit
dl
rm
css-minimizer-plugin.js.map
6642
0644
edit
dl
rm
devtools-ignore-list-plugin.d.ts
775
0644
edit
dl
rm
devtools-ignore-list-plugin.js
3367
0644
edit
dl
rm
devtools-ignore-list-plugin.js.map
5702
0644
edit
dl
rm
eval-source-map-dev-tool-plugin.d.ts
869
0644
edit
dl
rm
eval-source-map-dev-tool-plugin.js
10144
0644
edit
dl
rm
eval-source-map-dev-tool-plugin.js.map
17802
0644
edit
dl
rm
flight-client-entry-plugin.d.ts
3040
0644
edit
dl
rm
flight-client-entry-plugin.js
40923
0644
edit
dl
rm
flight-client-entry-plugin.js.map
65905
0644
edit
dl
rm
flight-manifest-plugin.d.ts
2144
0644
edit
dl
rm
flight-manifest-plugin.js
23049
0644
edit
dl
rm
flight-manifest-plugin.js.map
33545
0644
edit
dl
rm
jsconfig-paths-plugin.d.ts
2248
0644
edit
dl
rm
jsconfig-paths-plugin.js
8254
0644
edit
dl
rm
jsconfig-paths-plugin.js.map
14283
0644
edit
dl
rm
memory-with-gc-cache-plugin.d.ts
517
0644
edit
dl
rm
memory-with-gc-cache-plugin.js
4695
0644
edit
dl
rm
memory-with-gc-cache-plugin.js.map
6989
0644
edit
dl
rm
middleware-plugin.d.ts
1783
0644
edit
dl
rm
middleware-plugin.js
29617
0644
edit
dl
rm
middleware-plugin.js.map
49521
0644
edit
dl
rm
mini-css-extract-plugin.d.ts
190
0644
edit
dl
rm
mini-css-extract-plugin.js
724
0644
edit
dl
rm
mini-css-extract-plugin.js.map
568
0644
edit
dl
rm
next-drop-client-page-plugin.d.ts
305
0644
edit
dl
rm
next-drop-client-page-plugin.js
3561
0644
edit
dl
rm
next-drop-client-page-plugin.js.map
5232
0644
edit
dl
rm
next-font-manifest-plugin.d.ts
1373
0644
edit
dl
rm
next-font-manifest-plugin.js
6814
0644
edit
dl
rm
next-font-manifest-plugin.js.map
10868
0644
edit
dl
rm
next-trace-entrypoints-plugin.d.ts
2418
0644
edit
dl
rm
next-trace-entrypoints-plugin.js
29635
0644
edit
dl
rm
next-trace-entrypoints-plugin.js.map
45878
0644
edit
dl
rm
nextjs-require-cache-hot-reloader.d.ts
416
0644
edit
dl
rm
nextjs-require-cache-hot-reloader.js
2194
0644
edit
dl
rm
nextjs-require-cache-hot-reloader.js.map
3451
0644
edit
dl
rm
optional-peer-dependency-resolve-plugin.d.ts
140
0644
edit
dl
rm
optional-peer-dependency-resolve-plugin.js
2115
0644
edit
dl
rm
optional-peer-dependency-resolve-plugin.js.map
3039
0644
edit
dl
rm
pages-manifest-plugin.d.ts
754
0644
edit
dl
rm
pages-manifest-plugin.js
5889
0644
edit
dl
rm
pages-manifest-plugin.js.map
9206
0644
edit
dl
rm
profiling-plugin.d.ts
926
0644
edit
dl
rm
profiling-plugin.js
13484
0644
edit
dl
rm
profiling-plugin.js.map
22355
0644
edit
dl
rm
react-loadable-plugin.d.ts
1591
0644
edit
dl
rm
react-loadable-plugin.js
8322
0644
edit
dl
rm
react-loadable-plugin.js.map
13547
0644
edit
dl
rm
rspack-flight-client-entry-plugin.d.ts
789
0644
edit
dl
rm
rspack-flight-client-entry-plugin.js
4422
0644
edit
dl
rm
rspack-flight-client-entry-plugin.js.map
7965
0644
edit
dl
rm
rspack-profiling-plugin.d.ts
284
0644
edit
dl
rm
rspack-profiling-plugin.js
2949
0644
edit
dl
rm
rspack-profiling-plugin.js.map
3862
0644
edit
dl
rm
slow-module-detection-plugin.d.ts
413
0644
edit
dl
rm
slow-module-detection-plugin.js
8580
0644
edit
dl
rm
slow-module-detection-plugin.js.map
13744
0644
edit
dl
rm
subresource-integrity-plugin.d.ts
326
0644
edit
dl
rm
subresource-integrity-plugin.js
2653
0644
edit
dl
rm
subresource-integrity-plugin.js.map
4355
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/build/webpack/plugins/react-loadable-plugin.js
(8322B)
/** COPYRIGHT (c) 2017-present James Kyle <me@thejameskyle.com> MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWAR */ // Implementation of this PR: https://github.com/jamiebuilds/react-loadable/pull/132 // Modified to strip out unneeded results for Next's specific use case "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "ReactLoadablePlugin", { enumerable: true, get: function() { return ReactLoadablePlugin; } }); const _path = /*#__PURE__*/ _interop_require_default(require("path")); const _webpack = require("next/dist/compiled/webpack/webpack"); const _constants = require("../../../shared/lib/constants"); function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function getModuleId(compilation, module) { return compilation.chunkGraph.getModuleId(module); } function getModuleFromDependency(compilation, dep) { return compilation.moduleGraph.getModule(dep); } function getOriginModuleFromDependency(compilation, dep) { return compilation.moduleGraph.getParentModule(dep); } function getChunkGroupFromBlock(compilation, block) { return compilation.chunkGraph.getBlockChunkGroup(block); } function buildManifest(_compiler, compilation, projectSrcDir, dev, shouldCreateDynamicCssManifest) { if (!projectSrcDir) { return { reactLoadableManifest: {}, dynamicCssManifest: [] }; } const dynamicCssManifestSet = new Set(); let manifest = {}; // This is allowed: // import("./module"); <- ImportDependency // We don't support that: // import(/* webpackMode: "eager" */ "./module") <- ImportEagerDependency // import(`./module/${param}`) <- ImportContextDependency // Find all dependencies blocks which contains a `import()` dependency const handleBlock = (block)=>{ block.blocks.forEach(handleBlock); const chunkGroup = getChunkGroupFromBlock(compilation, block); for (const dependency of block.dependencies){ if (dependency.type.startsWith('import()')) { // get the referenced module const module = getModuleFromDependency(compilation, dependency); if (!module) return; // get the module containing the import() const originModule = getOriginModuleFromDependency(compilation, dependency); const originRequest = originModule == null ? void 0 : originModule.resource; if (!originRequest) return; // We construct a "unique" key from origin module and request // It's not perfect unique, but that will be fine for us. // We also need to construct the same in the babel plugin. const key = `${_path.default.relative(projectSrcDir, originRequest)} -> ${dependency.request}`; // Capture all files that need to be loaded. const files = new Set(); if (manifest[key]) { // In the "rare" case where multiple chunk groups // are created for the same `import()` or multiple // import()s reference the same module, we merge // the files to make sure to not miss files // This may cause overfetching in edge cases. for (const file of manifest[key].files){ files.add(file); } } // There might not be a chunk group when all modules // are already loaded. In this case we only need need // the module id and no files if (chunkGroup) { for (const chunk of chunkGroup.chunks){ chunk.files.forEach((file)=>{ if ((file.endsWith('.js') || file.endsWith('.css')) && file.match(/^static\/(chunks|css)\//)) { files.add(file); if (shouldCreateDynamicCssManifest && file.endsWith('.css')) { dynamicCssManifestSet.add(file); } } }); } } // usually we have to add the parent chunk groups too // but we assume that all parents are also imported by // next/dynamic so they are loaded by the same technique // add the id and files to the manifest const id = dev ? key : getModuleId(compilation, module); manifest[key] = { id, files: Array.from(files) }; } } }; for (const module of compilation.modules){ module.blocks.forEach(handleBlock); } manifest = Object.keys(manifest).sort()// eslint-disable-next-line no-sequences .reduce((a, c)=>(a[c] = manifest[c], a), {}); return { reactLoadableManifest: manifest, dynamicCssManifest: Array.from(dynamicCssManifestSet) }; } class ReactLoadablePlugin { constructor(opts){ this.filename = opts.filename; this.pagesOrAppDir = opts.pagesDir || opts.appDir; this.isPagesDir = Boolean(opts.pagesDir); this.runtimeAsset = opts.runtimeAsset; this.dev = opts.dev; } createAssets(compiler, compilation) { const projectSrcDir = this.pagesOrAppDir ? _path.default.dirname(this.pagesOrAppDir) : undefined; const shouldCreateDynamicCssManifest = !this.dev && this.isPagesDir; const { reactLoadableManifest, dynamicCssManifest } = buildManifest(compiler, compilation, projectSrcDir, this.dev, shouldCreateDynamicCssManifest); compilation.emitAsset(this.filename, new _webpack.sources.RawSource(JSON.stringify(reactLoadableManifest, null, 2))); if (this.runtimeAsset) { compilation.emitAsset(this.runtimeAsset, new _webpack.sources.RawSource(`self.__REACT_LOADABLE_MANIFEST=${JSON.stringify(JSON.stringify(reactLoadableManifest))}`)); } // This manifest prevents removing server rendered <link> tags after client // navigation. This is only needed under Pages dir && Production && Webpack. // x-ref: https://github.com/vercel/next.js/pull/72959 if (shouldCreateDynamicCssManifest) { compilation.emitAsset(`${_constants.DYNAMIC_CSS_MANIFEST}.json`, new _webpack.sources.RawSource(JSON.stringify(dynamicCssManifest, null, 2))); // This is for edge runtime. compilation.emitAsset(`server/${_constants.DYNAMIC_CSS_MANIFEST}.js`, new _webpack.sources.RawSource(`self.__DYNAMIC_CSS_MANIFEST=${JSON.stringify(JSON.stringify(dynamicCssManifest))}`)); } } apply(compiler) { compiler.hooks.make.tap('ReactLoadableManifest', (compilation)=>{ compilation.hooks.processAssets.tap({ name: 'ReactLoadableManifest', stage: _webpack.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS }, ()=>{ this.createAssets(compiler, compilation); }); }); } } //# sourceMappingURL=react-loadable-plugin.js.map
Save
cmd:
run