`How to add a loader to an expression?
S
S
SomeHuman22021-01-02 22:59:29
webpack
SomeHuman2, 2021-01-02 22:59:29

How to add a loader to an expression?

Hello, the code is

require(`!ejs-loader?{esModule:false}[email protected]/extensions/noscript.ejs`)(data)

returns compiling html
but the problem is that I need to run such html through another loader, how can I do it correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2022-01-03
@SomeHuman2

You can build loader chains: require(`!a-loader!b-loader!c-loader!file')
But this is actually wrong. The correct approach is to register all the chains for the desired extension immediately in the webpack config, with all the necessary parameters and just do require(`file').

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question