/opt/canhelp/node_modules/next/dist/esm/build/webpack/plugins
NameSizeModeActions
minify-webpack-plugin/-0755rm
next-types-plugin/-0755rm
telemetry-plugin/-0755rm
wellknown-errors-plugin/-0755rm
app-build-manifest-plugin.js18510644editdlrm
app-build-manifest-plugin.js.map36960644editdlrm
build-manifest-plugin.js117840644editdlrm
build-manifest-plugin.js.map206200644editdlrm
copy-file-plugin.js19980644editdlrm
copy-file-plugin.js.map39100644editdlrm
css-chunking-plugin.js139620644editdlrm
css-chunking-plugin.js.map201440644editdlrm
css-minimizer-plugin.js36210644editdlrm
css-minimizer-plugin.js.map66680644editdlrm
devtools-ignore-list-plugin.js31550644editdlrm
devtools-ignore-list-plugin.js.map57030644editdlrm
eval-source-map-dev-tool-plugin.js99510644editdlrm
eval-source-map-dev-tool-plugin.js.map178140644editdlrm
flight-client-entry-plugin.js398790644editdlrm
flight-client-entry-plugin.js.map659620644editdlrm
flight-manifest-plugin.js213930644editdlrm
flight-manifest-plugin.js.map336560644editdlrm
jsconfig-paths-plugin.js75200644editdlrm
jsconfig-paths-plugin.js.map141880644editdlrm
memory-with-gc-cache-plugin.js44670644editdlrm
memory-with-gc-cache-plugin.js.map69750644editdlrm
middleware-plugin.js284630644editdlrm
middleware-plugin.js.map496570644editdlrm
mini-css-extract-plugin.js3500644editdlrm
mini-css-extract-plugin.js.map5590644editdlrm
next-drop-client-page-plugin.js31350644editdlrm
next-drop-client-page-plugin.js.map52260644editdlrm
next-font-manifest-plugin.js72180644editdlrm
next-font-manifest-plugin.js.map109220644editdlrm
next-trace-entrypoints-plugin.js285710644editdlrm
next-trace-entrypoints-plugin.js.map459250644editdlrm
nextjs-require-cache-hot-reloader.js18170644editdlrm
nextjs-require-cache-hot-reloader.js.map34600644editdlrm
optional-peer-dependency-resolve-plugin.js18610644editdlrm
optional-peer-dependency-resolve-plugin.js.map30230644editdlrm
pages-manifest-plugin.js47200644editdlrm
pages-manifest-plugin.js.map91820644editdlrm
profiling-plugin.js127420644editdlrm
profiling-plugin.js.map223290644editdlrm
react-loadable-plugin.js78730644editdlrm
react-loadable-plugin.js.map135570644editdlrm
rspack-flight-client-entry-plugin.js40290644editdlrm
rspack-flight-client-entry-plugin.js.map80080644editdlrm
rspack-profiling-plugin.js24360644editdlrm
rspack-profiling-plugin.js.map38280644editdlrm
slow-module-detection-plugin.js83300644editdlrm
slow-module-detection-plugin.js.map137340644editdlrm
subresource-integrity-plugin.js22380644editdlrm
subresource-integrity-plugin.js.map43800644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/esm/build/webpack/plugins/memory-with-gc-cache-plugin.js.map (6975B)
{"version":3,"sources":["../../../../src/build/webpack/plugins/memory-with-gc-cache-plugin.ts"],"sourcesContent":["/*\nThis plugin is based on the internal one in webpack but heavily modified to use a different caching heuristic.\nhttps://github.com/webpack/webpack/blob/853bfda35a0080605c09e1bdeb0103bcb9367a10/lib/cache/MemoryWithGcCachePlugin.js#L15\n\nhttps://github.com/webpack/webpack/blob/main/LICENSE\nCopyright JS Foundation and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n/*\nThe change in this plugin compared to the built-in one in webpack is that this plugin always cleans up after 5 compilations.\nThe built-in plugin only cleans up \"total modules / max generations\".\nThe default for max generations is 5, so 1/5th of the modules would be marked for deletion.\nThis plugin instead always checks the cache and decreases the time to live of all entries. That way memory is cleaned up earlier.\n*/\n\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport type { Compiler } from 'next/dist/compiled/webpack/webpack'\n\n// Webpack doesn't expose Etag as a type so get it this way instead.\ntype Etag = Parameters[1]\n\n/**\n * Entry in the memory cache\n */\ninterface CacheEntry {\n /**\n * Webpack provided etag\n */\n etag: Etag\n /**\n * Webpack provided data\n */\n data: unknown | null\n /**\n * Number of compilations left before the cache item is evicted.\n */\n ttl: number\n}\n\n// Used to hook into the memory stage of the webpack caching\nconst CACHE_STAGE_MEMORY = -10 // TODO: Somehow webpack.Cache.STAGE_MEMORY doesn't work.\n\nconst PLUGIN_NAME = 'NextJsMemoryWithGcCachePlugin'\n\nexport class MemoryWithGcCachePlugin {\n /**\n * Maximum number of compilations to keep the cache entry around for when it's not used.\n * We keep the modules for a few more compilations so that if you comment out a package and bring it back it doesn't need a full compile again.\n */\n private maxGenerations: number\n constructor({ maxGenerations }: { maxGenerations: number }) {\n this.maxGenerations = maxGenerations\n }\n apply(compiler: Compiler) {\n const maxGenerations = this.maxGenerations\n\n /**\n * The memory cache\n */\n const cache = new Map()\n\n /**\n * Cache cleanup implementation\n */\n function decreaseTTLAndEvict() {\n for (const [identifier, entry] of cache) {\n // Decrease item time to live\n entry.ttl--\n\n // if ttl is 0 or below, evict entry from the cache\n if (entry.ttl <= 0) {\n cache.delete(identifier)\n }\n }\n }\n compiler.hooks.afterDone.tap(PLUGIN_NAME, decreaseTTLAndEvict)\n compiler.cache.hooks.store.tap(\n { name: PLUGIN_NAME, stage: CACHE_STAGE_MEMORY },\n (identifier, etag, data) => {\n cache.set(identifier, { etag, data, ttl: maxGenerations })\n }\n )\n compiler.cache.hooks.get.tap(\n { name: PLUGIN_NAME, stage: CACHE_STAGE_MEMORY },\n (identifier, etag, gotHandlers) => {\n const cacheEntry = cache.get(identifier)\n // Item found\n if (cacheEntry !== undefined) {\n // When cache entry is hit we reset the counter.\n cacheEntry.ttl = maxGenerations\n // Handles `null` separately as it doesn't have an etag.\n if (cacheEntry.data === null) {\n return null\n }\n\n return cacheEntry.etag === etag ? cacheEntry.data : null\n }\n\n // Handle case where other cache does have the identifier, puts it into the memory cache\n gotHandlers.push((result, callback) => {\n cache.set(identifier, {\n // Handles `null` separately as it doesn't have an etag.\n etag: result === null ? null : etag,\n data: result,\n ttl: maxGenerations,\n })\n return callback()\n })\n\n // No item found\n return undefined\n }\n )\n compiler.cache.hooks.shutdown.tap(\n { name: PLUGIN_NAME, stage: CACHE_STAGE_MEMORY },\n () => {\n cache.clear()\n }\n )\n }\n}\n"],"names":["CACHE_STAGE_MEMORY","PLUGIN_NAME","MemoryWithGcCachePlugin","constructor","maxGenerations","apply","compiler","cache","Map","decreaseTTLAndEvict","identifier","entry","ttl","delete","hooks","afterDone","tap","store","name","stage","etag","data","set","get","gotHandlers","cacheEntry","undefined","push","result","callback","shutdown","clear"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,GAEA;;;;;AAKA,GA0BA,4DAA4D;AAC5D,MAAMA,qBAAqB,CAAC,GAAG,yDAAyD;;AAExF,MAAMC,cAAc;AAEpB,OAAO,MAAMC;IAMXC,YAAY,EAAEC,cAAc,EAA8B,CAAE;QAC1D,IAAI,CAACA,cAAc,GAAGA;IACxB;IACAC,MAAMC,QAAkB,EAAE;QACxB,MAAMF,iBAAiB,IAAI,CAACA,cAAc;QAE1C;;KAEC,GACD,MAAMG,QAAQ,IAAIC;QAElB;;KAEC,GACD,SAASC;YACP,KAAK,MAAM,CAACC,YAAYC,MAAM,IAAIJ,MAAO;gBACvC,6BAA6B;gBAC7BI,MAAMC,GAAG;gBAET,mDAAmD;gBACnD,IAAID,MAAMC,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