S
S
SomeHuman22021-12-26 00:11:03
webpack
SomeHuman2, 2021-12-26 00:11:03

Why are the loader settings reset?

Hello, I have

chainWebpack: (config) => {
    config.module
      .rule("ejs")
      .test(/\.ejs$/)
      .use("ejs-loader")
      .loader("ejs-loader")
      .set("options", {
        esModule: false,
        variable: "data",
      });
}

and htmlWebpackPlugin with Actually, if you do not explicitly specify the loader with the settings (example above) in the form
template: "./public/index.ejs",
template: "ejs-loader?{esModules:false}!./public/index.ejs",

the loader is not used
I guess because the chainWebpack is defined after applying the htmlWebpackPlugin, but is it possible to somehow make the loader be declared earlier and htmlWebpackPlugin load the file through the loader or in some other way to make it beautiful)) If possible

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