[Vuejs]-How implement sass:math into vue.config.js

0👍

After some time trying some solutions, the easiest has been implemented like this:

module.exports = {
  css: {
    loaderOptions: {
      scss: {
        prependData: '@use "sass:math";',
      },
    },
  },
};

As I use a global variable file, the final setup was like this:

module.exports = {
  css: {
    loaderOptions: {
      scss: {
        prependData: `
          @use "sass:math";
          @import "~@/assets/scss/src/_variables.scss";
        `,
      },
    },
  },
};

Leave a comment