From b5850d72cb8059fb8d109ac348f0f82739cdd0c2 Mon Sep 17 00:00:00 2001 From: alexander-akait <4567934+alexander-akait@users.noreply.github.com> Date: Thu, 27 Aug 2026 16:52:34 +0000 Subject: [PATCH 1/6] docs: state what built-in CSS and HTML actually cover The loaders and plugins indexes called style-loader, css-loader, html-loader, MiniCssExtractPlugin and HtmlWebpackPlugin deprecated and superseded, which overstates it: the built-in support is experimental and does not cover preprocessors, css-loader's importLoaders, localIdentRegExp, getJSON and filter callbacks, style-loader's insert, attributes, styleTagTransform and lazy/singleton injection, html-loader's scriptingEnabled and postprocessor, or html-webpack-plugin's chunksSortMode, xhtml, showErrors, cache and plugin-hook ecosystem. Add a "What's built-in" section to both guides stating the scope as two columns, and point the index entries at it instead of declaring the packages superseded. Also scope the favicon claim: webpack emits the icons it is given, it does not generate size and format variants. --- src/content/concepts/loaders.mdx | 2 +- src/content/guides/asset-management.mdx | 2 +- src/content/guides/native-css.mdx | 17 +++++++- src/content/guides/native-html.mdx | 21 +++++++++- src/content/loaders/index.mdx | 10 ++--- src/content/plugins/index.mdx | 54 ++++++++++++------------- 6 files changed, 69 insertions(+), 37 deletions(-) diff --git a/src/content/concepts/loaders.mdx b/src/content/concepts/loaders.mdx index 407fe23aea24..8d7232350e04 100644 --- a/src/content/concepts/loaders.mdx +++ b/src/content/concepts/loaders.mdx @@ -44,7 +44,7 @@ export default { }; ``` -T> Plain `.css` files need no loader at all: webpack parses, extracts and minifies CSS itself — see [`experiments.css`](/configuration/experiments/#experimentscss) and the [Native CSS](/guides/native-css/) guide. A preprocessor still needs its loader, and `type: 'css/auto'` hands what the loader produces to webpack's CSS pipeline. +T> Plain `.css` files need no loader at all: webpack has experimental built-in CSS support that parses, extracts and minifies CSS itself — see [`experiments.css`](/configuration/experiments/#experimentscss) and the [Native CSS](/guides/native-css/) guide. A preprocessor still needs its loader, and `type: 'css/auto'` hands what the loader produces to webpack's CSS pipeline. ## Using Loaders diff --git a/src/content/guides/asset-management.mdx b/src/content/guides/asset-management.mdx index 317bf3d574a5..f2b9ff60318b 100644 --- a/src/content/guides/asset-management.mdx +++ b/src/content/guides/asset-management.mdx @@ -70,7 +70,7 @@ Webpack understands CSS on its own, so you can `import` a CSS file from a JavaSc import "./style.css"; ``` -Webpack parses the file — resolving its `@import` and `url()` references — and extracts it into a `.css` output file next to your bundle. CSS Modules, minification and content hashes all come from the same built-in support; the [Native CSS](/guides/native-css/) guide covers the whole feature set. +Webpack parses the file — resolving its `@import` and `url()` references — and extracts it into a `.css` output file next to your bundle. CSS Modules, minification and content hashes all come from the same built-in support, which is still experimental; [What's built-in](/guides/native-css/#whats-built-in) states what it covers and what still needs a loader. T> Built-in CSS is controlled by [`experiments.css`](/configuration/experiments/#experimentscss), which defaults to `'auto'`: it turns itself on unless a `module.rules` entry with a loader already matches your `.css` files. That means an existing `css-loader` / `style-loader` setup keeps working untouched — see [migrating off the CSS loaders](/guides/native-css/#migration-guide). diff --git a/src/content/guides/native-css.mdx b/src/content/guides/native-css.mdx index f1a2828a6466..ac880f168295 100644 --- a/src/content/guides/native-css.mdx +++ b/src/content/guides/native-css.mdx @@ -25,7 +25,22 @@ export default { }; ``` -With this option enabled, webpack understands `.css` files as first-class modules — parsing `@import` and `url()`, extracting stylesheets, generating content hashes, minifying, and supporting CSS Modules — without `css-loader`, `style-loader`, `mini-css-extract-plugin`, or `css-minimizer-webpack-plugin`. +With this option enabled, webpack understands `.css` files as first-class modules: it parses them itself instead of handing them to a loader. + +## What's built-in + +"Built-in" means webpack does the work itself, with no loader in the chain — not that it covers everything the CSS loaders do. The scope is exactly this: + +| Built in | Still needs a loader or plugin | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| Parsing `.css`; resolving `@import` and `url()` / `image-set()` / `src()` / `image()` | **Preprocessors** — Sass, Less, Stylus and PostCSS always keep their loaders | +| [CSS Modules](#css-modules): `composes`, `@value`, `:export`, `:local()` / `:global()` | `css-loader`'s `importLoaders`, `localIdentRegExp`, `getJSON`, and the `url` / `import` filter callbacks | +| [Extracting](#output-modes-exporttype) a `.css` file, or injecting a `