Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

除H5端以外,sass的api配置无效 #5152

Open
xiaohe0601 opened this issue Sep 19, 2024 · 1 comment
Open

除H5端以外,sass的api配置无效 #5152

xiaohe0601 opened this issue Sep 19, 2024 · 1 comment

Comments

@xiaohe0601
Copy link

sass1.79.1 开始会提示 2.0.0 后会移除 legacy API

Deprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.

通过配置 Vite 的 css.preprocessorOptions 可以修改使用的 sass API

// vite.config.ts

export default defineConfig({
  // ...
  css: {
    preprocessorOptions: {
      scss: {
        api: 'modern'
      }
    }
  }
});

配置后H5端不再出现warning,但是其他端依然会有提示

版本信息

  • uniapp:3.0.0-4020420240722002
  • vue:3.4.38
  • sass:1.79.1
@Subilan
Copy link

Subilan commented Sep 19, 2024

但是怎么才能知道有哪些代码用到了 legacy API 呢。。。这排查起来也不容易呀。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants