Open xiaohe0601 opened 1 month ago
sass 从 1.79.1 开始会提示 2.0.0 后会移除 legacy API
sass
1.79.1
legacy
Deprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
通过配置 Vite 的 css.preprocessorOptions 可以修改使用的 sass API
css.preprocessorOptions
// vite.config.ts export default defineConfig({ // ... css: { preprocessorOptions: { scss: { api: 'modern' } } } });
配置后H5端不再出现warning,但是其他端依然会有提示
但是怎么才能知道有哪些代码用到了 legacy API 呢。。。这排查起来也不容易呀。
确实有这个问题
https://github.com/vitejs/vite/issues/18164
sass
从1.79.1
开始会提示 2.0.0 后会移除legacy
API通过配置 Vite 的
css.preprocessorOptions
可以修改使用的sass
API配置后H5端不再出现warning,但是其他端依然会有提示
版本信息