diff --git a/src/content/configuration/experiments.mdx b/src/content/configuration/experiments.mdx index 4786859a4dda..78ee14be708e 100644 --- a/src/content/configuration/experiments.mdx +++ b/src/content/configuration/experiments.mdx @@ -7,6 +7,7 @@ contributors: - chenxsan - anshumanv - snitin315 + - burhanuday --- ## experiments @@ -184,6 +185,35 @@ Detect changes to remote resources and upgrade them automatically. Enable native CSS support. Note that it's an experimental feature still under development and will be enabled by default in webpack v6, however you can track the progress on [GitHub](https://github.com/webpack/webpack/issues/14893). +- Type: + + - `boolean` + - `CssExperimentOptions` + + ```ts + { + exportsOnly?: boolean; + } + ``` + +Experimental features: + +- CSS Modules support: webpack will generate a unique name for each CSS class. Use the `.module.css` extension for CSS Modules. +- Style-specific fields resolution in `package.json` files: + webpack will look for `style` field in `package.json` files and use that if it + exists for imports inside CSS files. + + For example, if you add `@import 'bootstrap';` to your CSS file, webpack will look for `bootstrap` in `node_modules` and use the `style` field in `package.json` from there. If `style` field is not found, webpack will use the `main` field instead to preserve backward compatibility. + +- Content hash for CSS files: webpack will generate a content hash for CSS files and use it in the filename. This is useful for long-term caching. +- CSS extraction: webpack will extract CSS into a separate file. This functionality replaces the need for `mini-css-extract-plugin` and `css-loader`, as it provides native support. +- CSS imports: webpack will inline CSS imports into the generated CSS file. +- Hot Module Reload (HMR): webpack supports HMR for CSS files. This means that changes made to CSS files will be reflected in the browser without a full page reload. + +#### experiments.css.exportsOnly + +Avoid generating and loading a stylesheet and only embed exports from css into output javascript files. + - Type: `boolean` ### experiments.cacheUnaffected

AltStyle によって変換されたページ (->オリジナル) /