[Vuejs]-How to include appropriate SCSS file?

0๐Ÿ‘

โœ…

So, the solution I found is to use css additionalData prop inside the vue.config.js. Code:

const filename = process.env.VUE_APP_TEMPLATE;

const additionalData =
  ... +
  `@import "src/assets/styles/setup/${ filename }.scss";`;

module.exports = {
  css: {
    loaderOptions: {
      sass: { additionalData }
    }
  },
  ...
 }

Leave a comment