最新文章:

您的位置: 富录-前端开发|web技术博客 > 系统环境 > 处理Deprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.警告

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

发布时间:2024年10月09日 评论数:抢沙发阅读数: 1763

    最近是不是都看到过这样的警告?

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

    点击查看原图

    对于有强迫症的,看到这一片肯定很烦。

    咋回事呢?

    原来Sass有个重大变更

    Dart Sass 最初使用的API基于 Node Sass,但在 Dart Sass 1.45.0 中将其替换为新的现代API。旧版JS API现已弃用,并将在 Dart Sass  2.0.0 中被删除。

    详情:请看https://sass-lang.com/documentation/breaking-changes/legacy-js-api/


    如何处理呢?

    简单,在vite.config.js文件中加上一些配置,如下

    export default defineConfig({
      css: {
        preprocessorOptions: {
          scss: {
            api: 'modern-compiler'
          }
        },
      },
      ...
    })

二维码加载中...
本文作者:DGF      文章标题: 处理Deprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.警告
本文地址: https://arbays.com/post-245.html     本文已被百度收录!
版权声明:若无注明,本文皆为“富录-前端开发|web技术博客”原创,转载请保留文章出处。
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
提交评论

清空信息
关闭评论