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
docs(resolve): document module-sync in default conditionNames (#8237)
Webpack 5.107 adds "module-sync" to the default conditionNames for ESM,
CJS, AMD, worker, wasm, and build-dependency resolvers, aligning with
Node.js. This updates the per-dependency conditionNames defaults table
in resolve.mdx and notes the alignment with Node.js's module-sync
community condition.
Refs: webpack/webpack#20933
Copy file name to clipboardExpand all lines: src/content/configuration/resolve.mdx
+14-8Lines changed: 14 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -330,14 +330,20 @@ For example, with `target: "web"` (the default) and `mode: "production"`, the ba
330
330
331
331
Webpack further adjusts `conditionNames` through [`resolve.byDependency`](/configuration/resolve/#resolvebydependency) depending on how a module is imported. The `"..."` token inherits from the base conditions above.
For instance, when a file uses `import` in a project with `target: "web"` and `mode: "production"`, the final resolved conditions are `["import", "module", "webpack", "production", "browser"]`.
<Badge text="5.107.0+" /> `"module-sync"` is included in the default conditions
341
+
to align with Node.js, which exposes the `module-sync` community condition for
342
+
synchronously-loadable ESM. Packages that publish a `module-sync` export in
343
+
their `package.json` are picked up automatically without additional
344
+
configuration.
345
+
346
+
For instance, when a file uses `import` in a project with `target: "web"` and `mode: "production"`, the final resolved conditions are `["import", "module-sync", "module", "webpack", "production", "browser"]`.
341
347
342
348
T> The `resolveLoader` option uses different defaults for `conditionNames`: `["loader", "require", "node"]`. See [resolveLoader](#resolveloader).
0 commit comments