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 · 3 comments
Open

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

xiaohe0601 opened this issue Sep 19, 2024 · 3 comments

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 呢。。。这排查起来也不容易呀。

@Ttou
Copy link

Ttou commented Sep 22, 2024

确实有这个问题

@Ttou
Copy link

Ttou commented Sep 23, 2024

vitejs/vite#18164

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

3 participants