Answer the question
In order to leave comments, you need to log in
Is it possible to use require on a variable?
Hello, usually the path to the file is specified in require, but is it possible to specify just the content for conversion by loaders instead of the path?
For example, to
require(`file-loader!` "someTestContentHere" ).default
someTestContentHere
?
Answer the question
In order to leave comments, you need to log in
No. But you can write your own loader that will do it. It's not hard.
However, it is not clear why the heck is a button accordion for a goat. Just put the real file separately and that's it, than inline horrors to fence. This directly contradicts the idea of modularity, on which all this is built.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question