D
D
devilsD2019-04-12 01:55:37
webpack
devilsD, 2019-04-12 01:55:37

Why does html-webpack-plugin incorrectly include includes (required)?

I use html-webpack-plugin, I collect the includes like this:
webpack.config.js

{
        test: /\.html$/,
        include: path.resolve(__dirname, 'src/html/includes'),
        use: ['raw-loader']
      },

index.html Shows "[object Module]" instead of the contents of the file
<%= require('./../includes/header.html') %>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
devilsD, 2019-04-12
@devilsD

The problem was in the raw-loader, I changed it to html-loader with interpolate: true and everything started up.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question