/opt/canhelp/node_modules/next/dist/build/webpack/loaders
NameSizeModeActions
css-loader/-0755rm
devtool/-0755rm
lightningcss-loader/-0755rm
metadata/-0755rm
next-app-loader/-0755rm
next-edge-app-route-loader/-0755rm
next-edge-ssr-loader/-0755rm
next-flight-loader/-0755rm
next-font-loader/-0755rm
next-image-loader/-0755rm
next-route-loader/-0755rm
next-style-loader/-0755rm
postcss-loader/-0755rm
resolve-url-loader/-0755rm
empty-loader.d.ts1560644editdlrm
empty-loader.js3200644editdlrm
empty-loader.js.map3880644editdlrm
error-loader.d.ts1560644editdlrm
error-loader.js14280644editdlrm
error-loader.js.map16740644editdlrm
get-module-build-info.d.ts14950644editdlrm
get-module-build-info.js3580644editdlrm
get-module-build-info.js.map19370644editdlrm
modularize-import-loader.d.ts6390644editdlrm
modularize-import-loader.js12550644editdlrm
modularize-import-loader.js.map17200644editdlrm
next-barrel-loader.d.ts31400644editdlrm
next-barrel-loader.js103450644editdlrm
next-barrel-loader.js.map155050644editdlrm
next-client-pages-loader.d.ts1860644editdlrm
next-client-pages-loader.js12380644editdlrm
next-client-pages-loader.js.map19060644editdlrm
next-edge-function-loader.d.ts3700644editdlrm
next-edge-function-loader.js19080644editdlrm
next-edge-function-loader.js.map32060644editdlrm
next-error-browser-binary-loader.d.ts1610644editdlrm
next-error-browser-binary-loader.js7140644editdlrm
next-error-browser-binary-loader.js.map9290644editdlrm
next-flight-action-entry-loader.d.ts4760644editdlrm
next-flight-action-entry-loader.js9720644editdlrm
next-flight-action-entry-loader.js.map19550644editdlrm
next-flight-client-entry-loader.d.ts6240644editdlrm
next-flight-client-entry-loader.js19780644editdlrm
next-flight-client-entry-loader.js.map41020644editdlrm
next-flight-client-module-loader.d.ts1820644editdlrm
next-flight-client-module-loader.js22350644editdlrm
next-flight-client-module-loader.js.map34240644editdlrm
next-flight-css-loader.d.ts4200644editdlrm
next-flight-css-loader.js20800644editdlrm
next-flight-css-loader.js.map30600644editdlrm
next-flight-server-reference-proxy-loader.d.ts2370644editdlrm
next-flight-server-reference-proxy-loader.js13340644editdlrm
next-flight-server-reference-proxy-loader.js.map18830644editdlrm
next-invalid-import-error-loader.d.ts2480644editdlrm
next-invalid-import-error-loader.js5680644editdlrm
next-invalid-import-error-loader.js.map7330644editdlrm
next-metadata-image-loader.d.ts5060644editdlrm
next-metadata-image-loader.js63130644editdlrm
next-metadata-image-loader.js.map96980644editdlrm
next-metadata-route-loader.d.ts3980644editdlrm
next-metadata-route-loader.js94230644editdlrm
next-metadata-route-loader.js.map137040644editdlrm
next-middleware-asset-loader.d.ts1150644editdlrm
next-middleware-asset-loader.js13320644editdlrm
next-middleware-asset-loader.js.map15310644editdlrm
next-middleware-loader.d.ts5300644editdlrm
next-middleware-loader.js20220644editdlrm
next-middleware-loader.js.map35720644editdlrm
next-middleware-wasm-loader.d.ts1140644editdlrm
next-middleware-wasm-loader.js12720644editdlrm
next-middleware-wasm-loader.js.map14890644editdlrm
next-root-params-loader.d.ts2780644editdlrm
next-root-params-loader.js66300644editdlrm
next-root-params-loader.js.map85330644editdlrm
next-swc-loader.d.ts8660644editdlrm
next-swc-loader.js110420644editdlrm
next-swc-loader.js.map149970644editdlrm
utils.d.ts5890644editdlrm
utils.js37710644editdlrm
utils.js.map58870644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-barrel-loader.d.ts (3140B)
/** * ## Barrel Optimizations * * This loader is used to optimize the imports of "barrel" files that have many * re-exports. Currently, both Node.js and Webpack have to enter all of these * submodules even if we only need a few of them. * * For example, say a file `foo.js` with the following contents: * * export { a } from './a' * export { b } from './b' * export { c } from './c' * ... * * If the user imports `a` only, this loader will accept the `names` option to * be `['a']`. Then, it request the "__barrel_transform__" SWC transform to load * `foo.js` and receive the following output: * * export const __next_private_export_map__ = '[["a","./a","a"],["b","./b","b"],["c","./c","c"],...]' * * format: '["", "", ""]' * e.g.: import { a as b } from './module-a' => '["b", "./module-a", "a"]' * * The export map, generated by SWC, is a JSON that represents the exports of * that module, their original file, and their original name (since you can do * `export { a as b }`). * * Then, this loader can safely remove all the exports that are not needed and * re-export the ones from `names`: * * export { a } from './a' * * That's the basic situation and also the happy path. * * * * ## Wildcard Exports * * For wildcard exports (e.g. `export * from './a'`), it becomes a bit more complicated. * Say `foo.js` with the following contents: * * export * from './a' * export * from './b' * export * from './c' * ... * * If the user imports `bar` from it, SWC can never know which files are going to be * exporting `bar`. So, we have to keep all the wildcard exports and do the same * process recursively. This loader will return the following output: * * export * from '__barrel_optimize__?names=bar&wildcard!=!./a' * export * from '__barrel_optimize__?names=bar&wildcard!=!./b' * export * from '__barrel_optimize__?names=bar&wildcard!=!./c' * ... * * The "!=!" tells Webpack to use the same loader to process './a', './b', and './c'. * After the recursive process, the "inner loaders" will either return an empty string * or: * * export * from './target' * * Where `target` is the file that exports `bar`. * * * * ## Non-Barrel Files * * If the file is not a barrel, we can't apply any optimizations. That's because * we can't easily remove things from the file. For example, say `foo.js` with: * * const v = 1 * export function b () { * return v * } * * If the user imports `b` only, we can't remove the `const v = 1` even though * the file is side-effect free. In these caes, this loader will simply re-export * `foo.js`: * * export * from './foo' * * Besides these cases, this loader also carefully handles the module cache so * SWC won't analyze the same file twice, and no instance of the same file will * be accidentally created as different instances. */ import type webpack from 'webpack'; declare const NextBarrelLoader: (this: webpack.LoaderContext<{ names: string[]; swcCacheDir: string; }>) => Promise; export default NextBarrelLoader;