img

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

2023-07-02 0条评论 252次阅读 JavaScript


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 *;'
      }
    }
  },

💬 COMMENT


🦄 支持markdown语法

👋友