Answers for "vue global scss"

7

vue scss

npm install sass-loader node-sass style-loader --save-dev
Posted by: Guest on April-12-2020
3

setup scss in vue

npm i node-sass sass-loader

// create the path: styles/main.scss in your src directory
–src
  |––styles
  |––main.scss

// add this to your vue.config.js file in the root directory
module.exports = {
  css: {
    loaderOptions: {
      sass: {
        prependData: `@import "@/styles/_variables.scss";`
      }
    }
  }
};
Posted by: Guest on July-23-2020
0

vue global scss

module.exports = {
  css: {
    loaderOptions: {
      sass: {
        prependData: `
          @import "@/assets/scss/main.scss";
        `
      }
    }
  }
};
Posted by: Guest on October-06-2021

Browse Popular Code Answers by Language