Answer the question
In order to leave comments, you need to log in
VueJS: Is it possible to make global variables in preprocessors?
I do adaptation and theming of the application. There are some functions and variables that I need to use in every component like rem, getColor etc. and of course global variables are needed...
Of course, you don't want to constantly import styles into each component. Is it possible to implement my needs under vue?
PS: I use different preprocessors (stylus and sass) in different projects. I would like the solution (if any) to work with all preprocessors, otherwise I saw somehow under sass it was advised to use sass-resources-loader for these cases, but I work not only with sass.
Answer the question
In order to leave comments, you need to log in
if I understood the question correctly, then it has little to do with vue, closer to the project builder.
if you are using webpack look at
style-resources-loader package
For stylus, it is enough to globally specify files for import, for sass, it seems like you can’t do without crutches.
Got it https: //cli.vuejs.org/guide/css.html#passing-optio ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question