From 500feca4bcc262767800a5f63ec9eef88fd38fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0?= Date: Wed, 28 May 2025 00:31:53 +0900 Subject: [PATCH 1/2] refactor(css)!: always use sass compiler API (#19978) --- config/shared-options.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/shared-options.md b/config/shared-options.md index 3e293575..b2229f3a 100644 --- a/config/shared-options.md +++ b/config/shared-options.md @@ -227,7 +227,7 @@ Note if an inline config is provided, Vite will not search for other PostCSS con Specify options to pass to CSS pre-processors. The file extensions are used as keys for the options. The supported options for each preprocessor can be found in their respective documentation: - `sass`/`scss`: - - Select the sass API to use with `api: "modern-compiler" | "modern"` (default `"modern-compiler"` if `sass-embedded` is installed, otherwise `"modern"`). For the best performance, it's recommended to use `api: "modern-compiler"` with the `sass-embedded` package. + - Uses `sass-embedded` if installed, otherwise uses `sass`. For the best performance, it's recommended to install the `sass-embedded` package. - [Options](https://sass-lang.com/documentation/js-api/interfaces/stringoptions/) - `less`: [Options](https://lesscss.org/usage/#less-options). - `styl`/`stylus`: Only [`define`](https://stylus-lang.com/docs/js.html#define-name-node) is supported, which can be passed as an object. @@ -247,7 +247,6 @@ export default defineConfig({ }, }, scss: { - api: 'modern-compiler', // or "modern" importers: [ // ... ], From 1f6256bf6712db89c7b4b37f89d97c8bf440ace5 Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Wed, 28 May 2025 09:56:25 +0800 Subject: [PATCH 2/2] fix: resolved conflict --- config/shared-options.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/config/shared-options.md b/config/shared-options.md index 614e4770..1486667c 100644 --- a/config/shared-options.md +++ b/config/shared-options.md @@ -227,11 +227,7 @@ declare const __APP_VERSION__: string 指定传递给 CSS 预处理器的选项。文件扩展名用作选项的键。每个预处理器支持的选项可以在它们各自的文档中找到: - `sass`/`scss`: -<<<<<<< HEAD - - 选择要使用的 sass 应用程序接口 `api: "modern-compiler" | "modern"` (如果安装了`sass-embedded`,默认为`"modern-compiler"`,否则为 `"modern"`). 为获得最佳性能,建议使用 `api: "modern-compiler"` 和 `sass-embedded` 软件包。 -======= - - Uses `sass-embedded` if installed, otherwise uses `sass`. For the best performance, it's recommended to install the `sass-embedded` package. ->>>>>>> 500feca4bcc262767800a5f63ec9eef88fd38fed +- 如果已安装,则使用 `sass-embedded`,否则使用 `sass`。为了获得最佳性能,建议安装 `sass-embedded` 包。 - [Options](https://sass-lang.com/documentation/js-api/interfaces/stringoptions/) - `less`: [选项](https://lesscss.org/usage/#less-options). - `styl`/`stylus`: 仅支持 [`define`](https://stylus-lang.com/docs/js.html#define-name-node),可以作为对象传递。 @@ -251,10 +247,6 @@ export default defineConfig({ }, }, scss: { -<<<<<<< HEAD - api: 'modern-compiler', // 或 "modern" -======= ->>>>>>> 500feca4bcc262767800a5f63ec9eef88fd38fed importers: [ // ... ],