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 a3773f5
Browse filesBrowse the repository at this point in the historyBrowse files
feat: default experiments.css/html/asyncWebAssembly to "auto" (#21365)
* feat: default experiments css/html/asyncWebAssembly to "auto"
Default `experiments.css`, `experiments.html` and `experiments.asyncWebAssembly`
to `"auto"`, which enables the built-in module type unless the user already
registers a loader (or explicit type) for those files — so enabling them by
default does not break existing css-loader/html-loader/wasm-loader setups.
Detection lives on `RuleSetCompiler.hasRuleForResource` (reusing
`compileCondition`): it walks `module.rules` (including `oneOf`/`rules`), treats
`include`/`exclude` leniently, ignores `enforce: "pre"|"post"` loaders, and also
counts a `test` regexp that references the extension so filename-scoped loaders
are detected. `asyncWebAssembly` "auto" defers to `syncWebAssembly`.
Auto-enabled html/css stay below `.js` in the ESM resolve extensions (only an
explicit opt-in keeps `.html` ahead of `.js`), and `devtool` is resolved after
experiments so auto-enabled css still gets the default dev css source map.
* fix(html): hoist HtmlModulesPlugin requires out of the compilation hook
Enabling `experiments.html` by default applies HtmlModulesPlugin to every
build. Its lazy `require`s inside the newCompilation hook crashed a watch
rebuild that raced after Jest teardown; hoisting them to module scope fixes
that and avoids re-requiring per compilation. Keep the no-loader Errors case
opted out of the html experiment so it still exercises that path.
Default `experiments.css`, `experiments.html` and `experiments.asyncWebAssembly` to `"auto"`, enabling the built-in support unless a loader is registered for those files.
* Enable css support. `"auto"` (the default) enables the built-in CSS support unless a loader is registered for CSS files.
1359
1359
* @experimental
1360
1360
*/
1361
-
css?: boolean;
1361
+
css?: "auto"|boolean;
1362
1362
/**
1363
1363
* Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.
* Enable HTML entry support. Treats `.html` files as a first-class module type so they can be used directly as entry points.
1373
+
* Enable HTML entry support. Treats `.html` files as a first-class module type so they can be used directly as entry points. `"auto"` (the default) enables it unless a loader is registered for HTML files.
1374
1374
* @experimental
1375
1375
*/
1376
-
html?: boolean;
1376
+
html?: "auto"|boolean;
1377
1377
/**
1378
1378
* Compile entrypoints and import()s only when they are accessed.
* Enable css support. `"auto"` (the default) enables the built-in CSS support unless a loader is registered for CSS files.
3571
3571
* @experimental
3572
3572
*/
3573
-
css?: boolean;
3573
+
css?: "auto"|boolean;
3574
3574
/**
3575
3575
* Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.
* Enable HTML entry support. Treats `.html` files as a first-class module type so they can be used directly as entry points.
3585
+
* Enable HTML entry support. Treats `.html` files as a first-class module type so they can be used directly as entry points. `"auto"` (the default) enables it unless a loader is registered for HTML files.
3586
3586
* @experimental
3587
3587
*/
3588
-
html?: boolean;
3588
+
html?: "auto"|boolean;
3589
3589
/**
3590
3590
* Compile entrypoints and import()s only when they are accessed.
0 commit comments