vue3.0根目录新建文件vue.config.js

配置:

module.exports = {
    css: {
        loaderOptions: {
            sass: {
                prependData: `@import "@/assets/css/mixin.scss";`
            }
        }
    }
}

注:旧版本sass 用data: `@import "@/assets/css/mixin.scss";`

       新版本sass 用prependData: `@import "@/assets/css/mixin.scss";`

否则报错:options has an unknown property 'data'.

Logo

前往低代码交流专区

更多推荐