Mi archivo package.json se ve así:
{ scripts": { "start": "webpack-dev-server" }, "author": "Mak Alamin", "license": "ISC", "dependencies": { "bcryptjs": "^2.4.3", "body-parser": "^1.19.0", "express": "^4.17.1", "mongoose": "^6.0.12", "validator": "^13.6.0" }, "devDependencies": { "@babel/core": "^7.16.0", "@babel/preset-env": "^7.16.0", "babel-loader": "^8.2.3", "html-loader": "^3.0.0", "html-webpack-plugin": "^5.5.0", "webpack": "^5.61.0", "webpack-cli": "^4.9.1", "webpack-dev-server": "^4.4.0" } }Mi archivo webpack.config.js se ve así:
const path = require('path') const HtmlWebpackPlugin = require('html-webpack-plugin') module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js' }, mode: 'development', devServer: { port: 9000, compress: true, open: true, hot: true }, module: { rules: [ { test: /\.js$/, exclude: /(node_modules|bower_components)/, use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env'] } } }, { test: /\.html$/, loader: "html-loader", } ] }, plugins: [ new HtmlWebpackPlugin({ template: './src/index.html' }) ] }Estoy usando html-loader con webpack. El problema es que el reemplazo del módulo activo funciona bien cuando actualizo los archivos .js pero no funciona cuando actualizo los archivos .html.
¿Cómo funciona este módulo caliente también con archivos html?
¡Por favor ayuda!