westwick
3 years ago
173
7
Vue

globally include a settings.scss with vue-loader?

Posted 3 years ago by westwick

I find myself repeating this same pattern in every .vue file, in order to use variables, etc.:

    <style lang="scss">
      @import "../styles/settings.scss";
      
      .someclass { color: $some-variable; }
    </style>

or if it's nested in a folder I have to remember to be careful with the path:

    <style lang="scss">
      @import "../../styles/settings.scss";
    
    </style>

Is there a way to globally import that settings.scss file in every .vue file I create? I looked in the docs and didn't see it, but maybe I missed it, or maybe this is something I need to leverage webpack to do?

Please sign in or create an account to participate in this conversation.