Answer the question
In order to leave comments, you need to log in
How to make all scss files autostart another scss in nuxt?
Where to put the configuration in the nuxt.config file so that the scss compiler first runs the file with scss variables and only then compiles the desired file?
For everywhere to write @import('../../assets/plugins/_var.scss'); not so cool...
Answer the question
In order to leave comments, you need to log in
Solution:
There is a plugin for nuxt itself - nuxt-sass-resources-loader
// nuxt.config.js
modules: [
'nuxt-sass-resources-loader'
],
sassResources: [
resolve(__dirname, 'assets/_colors.scss')
],
Make an index.scss file into
it:
import '../../_var.scss';
import '../my.scss';
import 'huihui.scss';
...
@assets
, @components
, ... Google it, it’s really pleasing
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question