You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0af51c4
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: group more loose lib/ sources into directories (#22191)
* refactor(config): move the options pipeline into lib/config/
`validateSchema`, `WebpackOptionsDefaulter`, `WebpackOptionsApply` and its
`OptionsApply` base class are the steps between a user's config object and a
`Compiler`, and sat in `lib/` root beside the plugins they apply. They join
`defaults.js` and `normalization.js`, the two steps already in `lib/config/`.
Paths only: `types.d.ts` regenerates byte-identical and no deep path the
recorded ecosystem scan names stops resolving, so nothing needs a re-export.
The scan is refreshed here too (2026-09-17 to 2026-09-19) — download counts
moved, no path came or went.
* refactor: group resolving, loader, node, id and util sources
Eight more files leave `lib/` root: a new `lib/resolve/` takes `ResolverFactory`
and the two plugins that redirect a request before it reaches one
(`IgnorePlugin`, `NormalModuleReplacementPlugin`), while `LoaderOptionsPlugin`
and `LoaderTargetPlugin` join `lib/loaders/`, `NodeStuffPlugin` `lib/node/`,
`RecordIdsPlugin` `lib/ids/` and `RequestShortener` `lib/util/`.
`RequestShortener` keeps a re-export at its old path: `@nuxt/`- and
`@soda/friendly-errors-webpack-plugin` both declare webpack 5 support and
require it at the top level, for 1.6M weekly downloads. Nothing else here is
imported from outside — `LoaderTargetPlugin`'s one importer also requires
`lib/FunctionModulePlugin` and `lib/MultiEntryPlugin`, removed in webpack 5,
so it is recorded as unreachable rather than shimmed.
`schemas/plugins/IgnorePlugin.json` follows the file its `tsType` points at.
`types.d.ts` regenerates byte-identical.
* fix: point the moved WebpackOptionsApply at hot/ from its new depth
`hot/` is at the repo root, so the three `require.resolve` specifiers reaching
it need one more level from `lib/config/` than from `lib/` root. They were
missed because two sit inside a ternary and one is a template literal, none of
them adjacent to `require(`, which is what the path rewrite matched on.
Bundling `lib/index.js` reported each as a failed resolve, leaving only the
three optional image encoders `test/cases/large/big-assets` already expects.
-`lib/config/` — Everything between a user's config object and a `Compiler`:
64
+
`validateSchema` checks it against the schema, `normalization.js` canonicalizes its
65
+
shape, `defaults.js` fills values in, and `WebpackOptionsApply` reads the result into
66
+
the plugins it implies. `WebpackOptionsDefaulter` is the normalize-then-default pair
67
+
under one deprecated name, and `OptionsApply` the base class the apply step extends.
68
+
Also holds the target presets and `defineConfig`.
64
69
-`lib/container/` — Module Federation.
65
70
-`lib/context/` — Context modules (`require.context`, dynamic request directories) and the plugins narrowing them.
66
71
-`lib/css/` — CSS Modules, CSS parsing and generation.
@@ -80,17 +85,23 @@ The directory listings below are the canonical map of the repository. **Whenever
80
85
recording what each module exports and who uses it.
81
86
-`lib/hmr/` — Hot Module Replacement plugins.
82
87
-`lib/html/` — Experimental HTML support.
83
-
-`lib/ids/` — Module/chunk id assignment plugins.
88
+
-`lib/ids/` — Module/chunk id assignment plugins, and `RecordIdsPlugin`, which persists
89
+
the assignment across builds through `recordsPath`.
84
90
-`lib/javascript/` — JavaScript parsing (webpack's own ECMAScript parser, ported from acorn), generation, exports analysis. `syntax.js` serves every production a build reaches, so `grammar.js` (the full grammar) and `regexp.js` (the pattern validator) are installed onto the parser's prototype only when something asks for one — keep it that way and never `require` either from a path a build takes.
0 commit comments