P
P
Paxest2019-12-02 22:53:32
Sass
Paxest, 2019-12-02 22:53:32

How to merge sass files without using @import?

Good afternoon!
I need to remove all imports from sass files on assignment and have them built automatically.
For this I found require.context

function importAll (r) {
  return r.keys().map(r);
}
importAll (require.context ('./', true, /\.js$|scss$/));

But the problem is that I have files with variables that must come first when loaded, and this cannot be achieved with require.context. Only if imports are written in each file that needs these variables.
Question: Is it possible to configure webpack to find all sass files, merge them into one and only then apply loaders?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2019-12-02
@Paxest

https://www.npmjs.com/package/node-sass-glob-importer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question