We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes doesn't effect on hot reload. I have to restart the server to see the changes made on partial components created by this plugin.
my webpack.config.js file
const path = require("path"); const CopyPlugin = require("copy-webpack-plugin"); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const fs = require('fs'); const HtmlWebpackPlugin = require("html-webpack-plugin"); const HtmlWebpackSimpleIncludePlugin = require("html-webpack-simple-include-plugin");
module.exports = { entry: { main: "./src/index.js", }, mode: "development", devServer: { watchFiles: ["src/**/*"], hot: true, }, module: { rules: [ { test: /.css$/i, include: path.resolve(__dirname, "src"), use: [ MiniCssExtractPlugin.loader, 'css-loader', 'postcss-loader', ], }, { test: /.(png|svg|jpg|jpeg|gif)$/i, type: 'asset/resource', } ], }, resolve: { extensions: [".tsx", ".ts", ".js"], }, plugins: [ new MiniCssExtractPlugin({ filename: 'styles.css', }), new CopyPlugin({ patterns: [ { from: "src/assets", to: "assets" } ], }), new HtmlWebpackPlugin({ template: "src/index.html", }), new HtmlWebpackPlugin({ filename: "about.html", template: "src/about.html", }), new HtmlWebpackSimpleIncludePlugin([ { tag: '', content: fs.readFileSync(path.resolve(__dirname, "src/partials/footer.html")),
}, { tag: '<include-header />', content: fs.readFileSync(path.resolve(__dirname, "src/partials/header.html")), } ])
], output: { filename: "index.js", path: path.resolve(__dirname, "dist"), clean: true, }, };
The text was updated successfully, but these errors were encountered:
Hi, I'm not really actively working on this project anymore, but have you tried the following:
module.exports = { //... devServer: { watchContentBase: true } };
Further info at: https://v4.webpack.js.org/configuration/dev-server/#devserverwatchcontentbase
Sorry, something went wrong.
Thank you for your reply. I've tried it and doesn't work. It throws an error. I am using webpack v5
No branches or pull requests
Changes doesn't effect on hot reload. I have to restart the server to see the changes made on partial components created by this plugin.
my webpack.config.js file
const path = require("path");
const CopyPlugin = require("copy-webpack-plugin");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const fs = require('fs');
const HtmlWebpackPlugin = require("html-webpack-plugin");
const HtmlWebpackSimpleIncludePlugin = require("html-webpack-simple-include-plugin");
module.exports = {
entry: {
main: "./src/index.js",
},
mode: "development",
devServer: {
watchFiles: ["src/**/*"],
hot: true,
},
module: {
rules: [
{
test: /.css$/i,
include: path.resolve(__dirname, "src"),
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'postcss-loader',
],
},
{
test: /.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource',
}
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
plugins: [
new MiniCssExtractPlugin({
filename: 'styles.css',
}),
new CopyPlugin({
patterns: [
{ from: "src/assets", to: "assets" }
],
}),
new HtmlWebpackPlugin({
template: "src/index.html",
}),
new HtmlWebpackPlugin({
filename: "about.html",
template: "src/about.html",
}),
new HtmlWebpackSimpleIncludePlugin([
{
tag: '',
content: fs.readFileSync(path.resolve(__dirname, "src/partials/footer.html")),
],
output: {
filename: "index.js",
path: path.resolve(__dirname, "dist"),
clean: true,
},
};
The text was updated successfully, but these errors were encountered: