处理vite中Sass警告:The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0问题
问题原因:
The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0 - 警告提示表明你当前正在使用的 Dart Sass 版本中,旧的 JavaScript API 已经被弃用。
解决方法:
vite.config.ts
文件添加以下代码
// 设置scss的api类型为modern-compiler
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler'
}
}
},

结果:
终端不在出现Sass警告。