Created
March 25, 2019 15:20
-
-
Save darkylmnx/4fde825423a3f7f466a70dd2d2465b94 to your computer and use it in GitHub Desktop.
Load SCSS variables globally with Webpack in Vue or others
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In the vue.config.file | |
// I load globally in all my components 2 files | |
// that DO NOT contain CSS but just variables and functions | |
// If you add CSS in those files they would be duplicated in each component | |
module.exports = { | |
css: { | |
loaderOptions: { | |
sass: { | |
data: ` | |
@import "@/assets/scss/variables.scss"; | |
@import "@/assets/scss/mixins.scss"; | |
` | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment