首页
归档
笔记
树洞
搜索
友言

文章详情

Interesting People Record Interesting.

/ JavaScript / 文章详情

解决vite打包 @use rules must be written before any other rules.的问题

Sonder
2023-07-02
414字
1分钟
浏览 (953)

image.png

之前:

复制代码
 css: {
   preprocessorOptions: {
     scss: {
       additionalData: '@import "@/styles/variables.scss";@import "@/styles/mixin.scss";'
     }
   }
 },

之后:

复制代码
 css: {
   preprocessorOptions: {
     scss: {
       charset: false, // 避免出现: build时的 @charset 必须在第一行的警告
       additionalData: '@use "@/styles/variables.scss" as *;@use "@/styles/mixin.scss" as *;'
     }
   }
 },
下一篇 / 解决 Vite 引入 variables 变量样式文件报错 This file is already being loaded 问题

🎯 相关文章

💡 推荐文章

🕵️‍♂️ 评论 (0)