From b75bd8d2c036f5daf9cbd76c9c47eb6c54ac3abf Mon Sep 17 00:00:00 2001 From: LingyuCoder Date: Thu, 15 Jan 2026 13:09:04 +0800 Subject: [PATCH] feat: remove deprecated cssHeadDataCompression option --- packages/rspack/etc/core.api.md | 1 - packages/rspack/src/config/normalization.ts | 7 ----- packages/rspack/src/config/types.ts | 9 ------ website/docs/en/config/output.mdx | 33 --------------------- website/docs/zh/config/output.mdx | 33 --------------------- 5 files changed, 83 deletions(-) diff --git a/packages/rspack/etc/core.api.md b/packages/rspack/etc/core.api.md index 6bc9831c01d4..136203969607 100644 --- a/packages/rspack/etc/core.api.md +++ b/packages/rspack/etc/core.api.md @@ -5536,7 +5536,6 @@ export type Output = { chunkFilename?: ChunkFilename; crossOriginLoading?: CrossOriginLoading; cssFilename?: CssFilename; - cssHeadDataCompression?: boolean; cssChunkFilename?: CssChunkFilename; hotUpdateMainFilename?: HotUpdateMainFilename; hotUpdateChunkFilename?: HotUpdateChunkFilename; diff --git a/packages/rspack/src/config/normalization.ts b/packages/rspack/src/config/normalization.ts index ffa205ec23f3..bfea91437f79 100644 --- a/packages/rspack/src/config/normalization.ts +++ b/packages/rspack/src/config/normalization.ts @@ -12,7 +12,6 @@ import path from 'node:path'; import type { HttpUriPluginOptions } from '../builtin-plugin'; import type { Compilation } from '../Compilation'; import type WebpackError from '../lib/WebpackError'; -import { deprecate } from '../util'; import type { Amd, AssetModuleFilename, @@ -150,12 +149,6 @@ export const getNormalizedRspackOptions = ( )(config.entry) : getNormalizedEntryStatic(config.entry), output: nestedConfig(config.output, (output) => { - if ('cssHeadDataCompression' in output) { - deprecate( - 'cssHeadDataCompression is not used now, see https://github.com/web-infra-dev/rspack/pull/8534, this option could be removed in the future', - ); - } - const { library } = output; const libraryAsName = library; const libraryBase = diff --git a/packages/rspack/src/config/types.ts b/packages/rspack/src/config/types.ts index 175c0fa30e10..03a9ce148210 100644 --- a/packages/rspack/src/config/types.ts +++ b/packages/rspack/src/config/types.ts @@ -484,15 +484,6 @@ export type Output = { /** This option determines the name of CSS output files on disk. */ cssFilename?: CssFilename; - /** - * @deprecated this config is unused, and will be removed in the future. - * Rspack adds some metadata in CSS to parse CSS modules, and this configuration determines whether to compress these metadata. - * - * The value is `true` in production mode. - * The value is `false` in development mode. - * */ - cssHeadDataCompression?: boolean; - /** This option determines the name of non-initial CSS output files on disk. */ cssChunkFilename?: CssChunkFilename; diff --git a/website/docs/en/config/output.mdx b/website/docs/en/config/output.mdx index fa42a94341b7..6c206a0f96a1 100644 --- a/website/docs/en/config/output.mdx +++ b/website/docs/en/config/output.mdx @@ -1895,36 +1895,3 @@ Please use [`output.library.type`](#outputlibrarytype) instead as we might drop :::warning Prefer to use [`output.library.umdNamedDefine`](#outputlibraryumdnameddefine) instead. ::: - -## output.cssHeadDataCompression - - - -- **Type:** `boolean` -- **Default:** `false` for development mode, `true` for production mode - -Rspack adds some metadata in CSS to parse CSS modules, and this configuration determines whether to compress these metadata. - -For example - -```css -.local-a { - color: blue; -} - -head { - --webpack-main: a: local-a/&\.\/ src\/index\.module\.css; -} -``` - -After compress 👇 - -```css -.local-a { - color: blue; -} - -head { - --webpack-main: &\.\/ srcăindexāmoduleācss; -} -``` diff --git a/website/docs/zh/config/output.mdx b/website/docs/zh/config/output.mdx index 2389f0b4b7bc..03022d1812e1 100644 --- a/website/docs/zh/config/output.mdx +++ b/website/docs/zh/config/output.mdx @@ -1887,36 +1887,3 @@ export default { :::warning 最好使用 [`output.library.umdNamedDefine`](#outputlibraryumdnameddefine)。 ::: - -## output.cssHeadDataCompression - - - -- **类型:** `boolean` -- **默认值:** 在 development 模式下为 `false`,在 production 模式下为 `true` - -Rspack 会在 CSS 中添加一些元信息,用以解析 CSS modules,此配置决定是否压缩元信息。 - -例如 👇 - -```css -.local-a { - color: blue; -} - -head { - --webpack-main: a: local-a/&\.\/ src\/index\.module\.css; -} -``` - -压缩后 - -```css -.local-a { - color: blue; -} - -head { - --webpack-main: &\.\/ srcăindexāmoduleācss; -} -```