F
F
Froggyweb2020-12-06 13:12:07
webpack
Froggyweb, 2020-12-06 13:12:07

Webpack 5. How to preserve image folder structure?

There is a config

{
        test: /\.(?:svg|gif|png|jpg|jpeg|webp)$/i,
        type: "asset/resource",
        generator: {
          filename: "img/[path][name][ext]",
        },
      },


but the trouble is that path gives the path "_dev/img/correct path."
I would like to remove the _dev / img
file-loader in WP5 also gives the path from the root. Although in WP4 it seemed to work as it should.

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