/opt/canhelp/node_modules/next/dist/build/webpack/plugins
NameSizeModeActions
minify-webpack-plugin/-0755rm
next-types-plugin/-0755rm
telemetry-plugin/-0755rm
wellknown-errors-plugin/-0755rm
app-build-manifest-plugin.d.ts2880644editdlrm
app-build-manifest-plugin.js22850644editdlrm
app-build-manifest-plugin.js.map36490644editdlrm
build-manifest-plugin.d.ts18800644editdlrm
build-manifest-plugin.js127690644editdlrm
build-manifest-plugin.js.map205660644editdlrm
copy-file-plugin.d.ts4150644editdlrm
copy-file-plugin.js23900644editdlrm
copy-file-plugin.js.map38550644editdlrm
css-chunking-plugin.d.ts1750644editdlrm
css-chunking-plugin.js141780644editdlrm
css-chunking-plugin.js.map201620644editdlrm
css-minimizer-plugin.d.ts5740644editdlrm
css-minimizer-plugin.js41700644editdlrm
css-minimizer-plugin.js.map66420644editdlrm
devtools-ignore-list-plugin.d.ts7750644editdlrm
devtools-ignore-list-plugin.js33670644editdlrm
devtools-ignore-list-plugin.js.map57020644editdlrm
eval-source-map-dev-tool-plugin.d.ts8690644editdlrm
eval-source-map-dev-tool-plugin.js101440644editdlrm
eval-source-map-dev-tool-plugin.js.map178020644editdlrm
flight-client-entry-plugin.d.ts30400644editdlrm
flight-client-entry-plugin.js409230644editdlrm
flight-client-entry-plugin.js.map659050644editdlrm
flight-manifest-plugin.d.ts21440644editdlrm
flight-manifest-plugin.js230490644editdlrm
flight-manifest-plugin.js.map335450644editdlrm
jsconfig-paths-plugin.d.ts22480644editdlrm
jsconfig-paths-plugin.js82540644editdlrm
jsconfig-paths-plugin.js.map142830644editdlrm
memory-with-gc-cache-plugin.d.ts5170644editdlrm
memory-with-gc-cache-plugin.js46950644editdlrm
memory-with-gc-cache-plugin.js.map69890644editdlrm
middleware-plugin.d.ts17830644editdlrm
middleware-plugin.js296170644editdlrm
middleware-plugin.js.map495210644editdlrm
mini-css-extract-plugin.d.ts1900644editdlrm
mini-css-extract-plugin.js7240644editdlrm
mini-css-extract-plugin.js.map5680644editdlrm
next-drop-client-page-plugin.d.ts3050644editdlrm
next-drop-client-page-plugin.js35610644editdlrm
next-drop-client-page-plugin.js.map52320644editdlrm
next-font-manifest-plugin.d.ts13730644editdlrm
next-font-manifest-plugin.js68140644editdlrm
next-font-manifest-plugin.js.map108680644editdlrm
next-trace-entrypoints-plugin.d.ts24180644editdlrm
next-trace-entrypoints-plugin.js296350644editdlrm
next-trace-entrypoints-plugin.js.map458780644editdlrm
nextjs-require-cache-hot-reloader.d.ts4160644editdlrm
nextjs-require-cache-hot-reloader.js21940644editdlrm
nextjs-require-cache-hot-reloader.js.map34510644editdlrm
optional-peer-dependency-resolve-plugin.d.ts1400644editdlrm
optional-peer-dependency-resolve-plugin.js21150644editdlrm
optional-peer-dependency-resolve-plugin.js.map30390644editdlrm
pages-manifest-plugin.d.ts7540644editdlrm
pages-manifest-plugin.js58890644editdlrm
pages-manifest-plugin.js.map92060644editdlrm
profiling-plugin.d.ts9260644editdlrm
profiling-plugin.js134840644editdlrm
profiling-plugin.js.map223550644editdlrm
react-loadable-plugin.d.ts15910644editdlrm
react-loadable-plugin.js83220644editdlrm
react-loadable-plugin.js.map135470644editdlrm
rspack-flight-client-entry-plugin.d.ts7890644editdlrm
rspack-flight-client-entry-plugin.js44220644editdlrm
rspack-flight-client-entry-plugin.js.map79650644editdlrm
rspack-profiling-plugin.d.ts2840644editdlrm
rspack-profiling-plugin.js29490644editdlrm
rspack-profiling-plugin.js.map38620644editdlrm
slow-module-detection-plugin.d.ts4130644editdlrm
slow-module-detection-plugin.js85800644editdlrm
slow-module-detection-plugin.js.map137440644editdlrm
subresource-integrity-plugin.d.ts3260644editdlrm
subresource-integrity-plugin.js26530644editdlrm
subresource-integrity-plugin.js.map43550644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/build/webpack/plugins/slow-module-detection-plugin.js (8580B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "default", { enumerable: true, get: function() { return SlowModuleDetectionPlugin; } }); const _picocolors = require("../../../lib/picocolors"); const PLUGIN_NAME = 'SlowModuleDetectionPlugin'; const TreeSymbols = { VERTICAL_LINE: '│ ', BRANCH: '├─ ' }; const PATH_TRUNCATION_LENGTH = 120; // Matches node_modules paths, including pnpm-style paths const NODE_MODULES_PATH_PATTERN = /node_modules(?:\/\.pnpm)?\/(.*)/; const getModuleIdentifier = (module)=>{ const debugId = module.debugId; return String(debugId); }; const getModuleDisplayName = (module)=>{ const resourcePath = 'resource' in module && typeof module.resource === 'string' ? module.resource : undefined; if (!resourcePath) { return undefined; } let displayPath = resourcePath.replace(process.cwd(), '.'); const nodeModulesMatch = displayPath.match(NODE_MODULES_PATH_PATTERN); if (nodeModulesMatch) { return nodeModulesMatch[1]; } return displayPath; }; /** * Truncates a path to a maximum length. If the path exceeds this length, * it will be truncated in the middle and replaced with '...'. */ function truncatePath(path, maxLength) { // If the path length is within the limit, return it as is if (path.length <= maxLength) return path; // Calculate the available length for the start and end segments after accounting for '...' const availableLength = maxLength - 3; const startSegmentLength = Math.ceil(availableLength / 2); const endSegmentLength = Math.floor(availableLength / 2); // Extract the start and end segments of the path const startSegment = path.slice(0, startSegmentLength); const endSegment = path.slice(-endSegmentLength); // Return the truncated path with '...' in the middle return `${startSegment}...${endSegment}`; } class ModuleBuildTimeAnalyzer { constructor(options){ this.options = options; this.pendingModules = []; this.modules = new Map(); this.moduleParents = new Map(); this.moduleChildren = new Map(); this.isFinalized = false; this.moduleBuildTimes = new WeakMap(); this.buildTimeThresholdMs = options.buildTimeThresholdMs; } recordModuleBuildTime(module, duration) { // Webpack guarantees that no more modules will be built after finishModules hook is called, // where we generate the report. This check is just a defensive measure. if (this.isFinalized) { throw Object.defineProperty(new Error(`Invariant (SlowModuleDetectionPlugin): Module is recorded after the report is generated. This is a Next.js internal bug.`), "__NEXT_ERROR_CODE", { value: "E630", enumerable: false, configurable: true }); } if (duration < this.buildTimeThresholdMs) { return; // Skip fast modules } this.moduleBuildTimes.set(module, duration); this.pendingModules.push(module); } /** * For each slow module, traverses up the dependency chain to find all ancestor modules. * Builds a directed graph where: * 1. Each slow module and its ancestors become nodes * 2. Edges represent "imported by" relationships * 3. Root nodes are entry points with no parents * * The resulting graph allows us to visualize the import chains that led to slow builds. */ prepareReport(compilation) { for (const module of this.pendingModules){ const chain = new Set(); // Walk up the module graph until we hit a root module (no issuer) to populate the chain { let currentModule = module; chain.add(currentModule); while(true){ const issuerModule = compilation.moduleGraph.getIssuer(currentModule); if (!issuerModule) break; if (chain.has(issuerModule)) { throw Object.defineProperty(new Error(`Invariant (SlowModuleDetectionPlugin): Circular dependency detected in module graph. This is a Next.js internal bug.`), "__NEXT_ERROR_CODE", { value: "E631", enumerable: false, configurable: true }); } chain.add(issuerModule); currentModule = issuerModule; } } // Add all visited modules to our graph and create parent-child relationships let previousModule = null; for (const currentModule of chain){ const moduleId = getModuleIdentifier(currentModule); if (!this.modules.has(moduleId)) { this.modules.set(moduleId, currentModule); } if (previousModule) { this.moduleParents.set(previousModule, currentModule); let parentChildren = this.moduleChildren.get(currentModule); if (!parentChildren) { parentChildren = new Map(); this.moduleChildren.set(currentModule, parentChildren); } parentChildren.set(getModuleIdentifier(previousModule), previousModule); } previousModule = currentModule; } } this.isFinalized = true; } generateReport(compilation) { if (!this.isFinalized) { this.prepareReport(compilation); } // Find root modules (those with no parents) const rootModules = [ ...this.modules.values() ].filter((node)=>!this.moduleParents.has(node)); const formatModuleNode = (node, depth)=>{ const moduleName = getModuleDisplayName(node) || ''; if (!moduleName) { return formatChildModules(node, depth); } const prefix = ' ' + TreeSymbols.VERTICAL_LINE.repeat(depth) + TreeSymbols.BRANCH; const moduleText = (0, _picocolors.blue)(truncatePath(moduleName, PATH_TRUNCATION_LENGTH - prefix.length)); const buildTimeMs = this.moduleBuildTimes.get(node); const duration = buildTimeMs ? (0, _picocolors.yellow)(` (${Math.ceil(buildTimeMs)}ms)`) : ''; return prefix + moduleText + duration + '\n' + formatChildModules(node, depth + 1); }; const formatChildModules = (node, depth)=>{ const children = this.moduleChildren.get(node); if (!children) return ''; return [ ...children ].map(([_, child])=>formatModuleNode(child, depth)).join(''); }; const report = rootModules.map((root)=>formatModuleNode(root, 0)).join(''); if (report) { console.log((0, _picocolors.green)(`🐌 Detected slow modules while compiling ${this.options.compilerType}:`) + '\n' + report); } } } class SlowModuleDetectionPlugin { constructor(options){ this.options = options; this.apply = (compiler)=>{ compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation)=>{ const analyzer = new ModuleBuildTimeAnalyzer(this.options); const moduleBuildStartTimes = new WeakMap(); compilation.hooks.buildModule.tap(PLUGIN_NAME, (module)=>{ moduleBuildStartTimes.set(module, performance.now()); }); compilation.hooks.succeedModule.tap(PLUGIN_NAME, (module)=>{ const startTime = moduleBuildStartTimes.get(module); if (!startTime) { throw Object.defineProperty(new Error(`Invariant (SlowModuleDetectionPlugin): Unable to find the start time for a module build. This is a Next.js internal bug.`), "__NEXT_ERROR_CODE", { value: "E629", enumerable: false, configurable: true }); } analyzer.recordModuleBuildTime(module, performance.now() - startTime); }); compilation.hooks.finishModules.tap(PLUGIN_NAME, ()=>{ analyzer.generateReport(compilation); }); }); }; } } //# sourceMappingURL=slow-module-detection-plugin.js.map