T
T
Tipylja2019-05-04 16:20:01
webpack
Tipylja, 2019-05-04 16:20:01

How to set multiple file processing rules in Webpack?

Hello. Please tell me how you can make it so that webpack would process the file with loaders that do not depend on each new one from the previous one

const pug = {
  test: /\.pug$/,
  use:[
    "pug-loader"
]};

Such a loader does one job, but I would also like to have another loader running at the same time, well, let's say, which will transfer files as is - "file-loader". If I add it to use, then the loaders will be executed one after another, from the bottom up, TRANSFERING the result to the next one to the other (from bottom to top, from right to left), and I need the result not to be passed to the next loader, but to be independent of it, like this is the first loader
. That is, I want to process the pug file with the "pug-loader" loader, and then transfer the same, original, unprocessed file using another loader - "file-loader". That is, the loaders must be isolated from each other.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question