The legacy JS API is deprecated and will be removed in Dart Sass 2.0
The legacy JS API is deprecated and will be removed in Dart Sass 2.0
更新了sass版本后,启动项目控制台一直在报错,影响开发效率,强迫症表示忍受不了。
字面意思是:Sass在2.0版本将会移除legacy JS API,所以现在使用会发出警告以提醒使用者尽快调整api。
如果使用的vite,官网也有说明
大致意思是:vite当前的css编译依然使用的兼容的js api的。
所以更改一下vite的设置即可:
export default defineConfig({
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler' // or "modern", "legacy"
},
},
},
})
原文地址:https://blog.csdn.net/qq_35487047/article/details/142631840
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!