-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
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
Webpack do not reload on included file change #75
Comments
same problem |
same on me... |
@Stosiu, you're using |
Same problem. Looks like webpack doesn't know about included files at all. I see possible solution there is to create custom loader, which will redefine |
same problem... i use pug-loader. in Sass hot reload page, but in pug does not reload page. |
if the entry point (index.js) prescribe index.pug, it will be overloaded. But it's better to do it only on Dev (not Prod). |
my problem solved with this config var HtmlWebpackPlugin = require("html-webpack-plugin");
var config = {
entry: {
ui: ['./src/categories/ui/index.js'],
},
output: {
path: './public/',
publicPath: '/',
filename: '[name].js',
chunkFilename: '[name]',
devtool: 'cheap-module-source-map',
},
module: {
loaders: [{
test: /\.pug$/,
loader: 'pug'
}]
},
plugins: [
new HtmlWebpackPlugin({
name: 'ui',
hash: true,
chunks: ['ui'],
template: './src/categories/ui/index.pug',
filename: 'index.html'
})
],
devServer: {
host: '0.0.0.0',
port: 8888,
contentBase: './public',
lazy: false
}
}; and this command
but hot reload did not get to work properly :| |
We also experiencing the same problem |
same issue, you can make your template a mixin and include the file then+ it (instead of including it directly), not perfect but work |
@SrShark this solves the problem ? ( hot reload page if use pug ) |
@OrionPro if you use the Module Replacement (HMR) No, don't resolve that problem. But if you use only DevServer, it is reloading perfect. |
@SrShark i use the Module Replacement (HMR) ... (HotModuleReplacementPlugin if we about him) |
Finally I found the solution. it was hard! but it's working. Webpack-dev-server - Module Replacement (HMR) don't reload PUG files changes |
@OrionPro i resolved it |
@SrShark and than this decision differs from import '../../pages/index/index.pug'; about which have already written above? I wrote about it on 2 Jun :). I then delete this when compile development... |
@SrShark that's what I see at localhost: 9000 http://prntscr.com/h6v6uj ...I have not done import 'raw-loader!./templates/index.pug', there is something wrong with this. My configuration http://prntscr.com/h6v7uc |
+1 |
Managed to get it worked without importing pug in js. Use this: https://github.com/jantimon/html-webpack-harddisk-plugin
|
I have the same problem. HTML files are not updated with Webpack Dev Server when I modified a PUG template.
|
I remember when I handled this problem, and now I come back to share my new improvement. I SOLVED whit this npm module. webpack-livereload-plugin
import LiveReloadPlugin from 'webpack-livereload-plugin'
plugins: [
new LiveReloadPlugin({
appendScriptTag: true
})
] |
Hello 👋🏻
I want to use
WebpackDevServer
withpug-loader
. My problem is that, it's not reloading the page after change in included files.Any ideas what am I doing wrong?
My
webpack.config.js
:server.js
:The text was updated successfully, but these errors were encountered: