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 doesn't recompile in watch mode when a partial template is changed. #15
Comments
yeah this is been an issue because I haven't found a 1st class way to hook into the html-webpack-plugin pipeline early enough to support that kind of thing. right now, I'm able to achieve this by injecting the html as a string into the already compiled code. I'm open to suggestions if you're familiar enough with this, or even if you wanted to give it a shot. that might also help solve the issue here: #7 |
I'll try; though, I'm pretty new to javascript and webpack, will probably take a while (need to read all the code and some docs first) and I might not come up with a "1st class" way to do it, but it'll be a good learning experience either way. |
That would be great! I just haven't found the time lately to do a deep dive. I'd be more than happy to help answer questions or even brainstorm if you end up trying to work through, just let me know :) |
Hi guys, I am on the very same situation, can't figure out how to do it, but it is quite annoing having to re-compile every time you change some of the partials.... Is there anyway I could help with this issue? |
hey @toabm does this solve the issue for you? #33 (comment) |
Here's a quick solution for wp5:
|
@tarponjargon The syntax of your "apply" snippet causes an error in my setup right in front of the first curly bracket ("unexpected token"). Is that really the proper setup? |
@rowild If you haven't solved this yet (or for anyone else in the future...) -- The snippet @tarponjargon mentioned is really just following the Webpack plugin syntax https://webpack.js.org/contribute/writing-a-plugin/#basic-plugin-architecture You could separate this plugin out into another file, following the guide above, or just include the class in the webpack config file.
Just replace |
You can use webpack-watch-external-files-plugin
|
In html-webpack-plugin the main.html file will recompile when changed. They fixed this problem in this issue, I think with this commit, by adding the template file to the compilation dependencies.That was in 2015, so idk if there have been api changes or whatnot, but as far as my searching has gone, I think this might be where I'm having trouble right now with both webpack watch and webpack-dev-server not recompiling as I try to edit some partial templates.
The text was updated successfully, but these errors were encountered: