Skip to content

Instantly share code, notes, and snippets.

@darkylmnx
Created March 25, 2019 15:20
Show Gist options
  • Save darkylmnx/4fde825423a3f7f466a70dd2d2465b94 to your computer and use it in GitHub Desktop.
Save darkylmnx/4fde825423a3f7f466a70dd2d2465b94 to your computer and use it in GitHub Desktop.
Load SCSS variables globally with Webpack in Vue or others
// 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