Adding Global Sass Files - gecko-8/devwiki GitHub Wiki
- Inside your src folder, add a folder called "styles".
- Add a .scss file in that folder (we'll use _variables.scss in this example).
- Open your vue.config.js file at the root of your project (create it if necessary).
- Add the following loaderOptions entry to the file:
module.exports = { css: { loaderOptions: { sass: { prependData: `@import "@/styles/_variables.scss";` } } } };
- If you have it running, shutdown and restart the development server.
IMPORTANT: this data will be imported to every component so only use this method for content that doesn't get rendered (e.g. variables, mixins, and functions)