[Vuejs]-Vue Plugin Development – Importing SCSS Globally

0👍

Solved by adding extract: false to css in vue.config.js. This one line thing cost me 14 hours to figure out, I hope nobody else has to go through this mess again. Here’s the full configuration:

module.exports = {
    css: {
        loaderOptions: {
            scss: {
                prependData: `@import "@/assets/scss/main.scss";`,
            },
        },
        extract: false,
    },
};

This will also take care of SCSS variables, mixins, etc. The plugin will not come with a separate CSS file with it, everything will be included in the bundled js files.

Leave a comment