Answer the question
In order to leave comments, you need to log in
How to configure webpack for layout?
With setting up a webpack for a project in which you only need to write in js (for example, react.js), everything is clear. But how can I make it so that I can make changes directly in index.html inside the build folder (which webpack-dev-server serves) so that webpack-dev-server reacts to them?
I understand that I’m most likely doing some kind of perversion and it’s much easier to set up browsersync on a gallop, but I still wanted to know how to work directly with html in webpack.
htmlWebpackPlugin simply makes it possible to specify some separate parts of the html file, but does not allow full layout.
Answer the question
In order to leave comments, you need to log in
using loader. but you need to import html into js otherwise it won't work
{
test: /\.html$/,
use: [
// Reference: https://github.com/webpack/raw-loader
// Allow loading html through js
{loader: 'raw-loader'}
]
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question