clem's avatar
Level 34

Stylus globalVueStyles

Hi,

Is it possible to inject Stylus variables using the globalVueStyles option?

It only seem to work with sass variables.

Thanks, Clement.

0 likes
1 reply
clem's avatar
clem
OP
Best Answer
Level 34

In the end, I'll stick with Sass but for future reference, here's how I got it to work editing the Laravel Mix Vue.js plugin:

I added stylus-resources-loader as a dependency

And added this in the vueLoaderOptions()

var stylusLoader = extractPlugin.extract({
    use: 'css-loader!stylus-loader?paths[]=node_modules',
    fallback: 'vue-style-loader'
})
stylusLoader.push({
        loader: 'stylus-resources-loader',
        options: {
            resources: Mix.paths.root(Config.globalVueStyles)
        }
});

And finally added this in the vueLoaderOptions.loaders object: stylus: stylusLoader

Please or to participate in this conversation.