// vue.config.js
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
    transpileDependencies: true,
    css: {
        loaderOptions: {
            sass: {
                // sass-loader:v10以上就用:additionalData
                // sass-loader:v8以上就用:prependData
                // sass-loader:v8-以下就用:data
                // 不加分号会报错
                additionalData: `@import "@/assets/styles/theme.scss";`
            },
        },
    },
})
/* theme.css */
$themeColor: #0e8fff;
<!-- index.vue -->
<template>
    <div></div>
</template>

<script>

export default {
   data() {
      return {}
    },
}
</script>
<style scoped lang="scss">
a {
    color: $themeColor;
}
</style>