-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Image path resolving is incorrect #7
Comments
hey @Wouter125 any chance you can throw this together in a Github repo where you're able to reproduce the error? it will make it easier to help you debug |
Aah sure, sounds good! I'll be making a small sample project later this week, currently caught up in loads of other things. Thanks in advance. 🙏 |
I'm gonna close this out for now since it's been >2w, feel free to reopen if you get a chance to put together a sample repo |
Heya, sorry this took almost a whole summer to get back to you, but I'm reopening it now because I finally got around to building a little sample project with the issue located (the other one where I previously had this issues is huge). You can find it over here; https://github.com/Wouter125/partial-issue If you run However all my image files inside partials (the footer image include) does not change and remains the same. Causing it to be incorrect and therefore I need to manually change it by hand after compiling. Hopefully it's something small, or the fact that I'm doing something wrong. Either way, let me know if you need any additional info so we can sort this out. Once again thanks for building this plugin! |
okay, so unless I'm mistaken, you have to require the image into the partial when using HTML Webpack Plugin itself, so for instance, if you were including this file in index.html, you would include it as:
However, using that same syntax in the partial isn't working, getting an error stating I'll try to find some time to take a look and see what I can figure out. |
I do not need the https://github.com/webpack-contrib/html-loader It might be that it is related to that, not completely sure? But if we do need a require, that will work for me as well. Let me know, happy to help! |
didnt forget about you. been poking at this here and there the last few days, just having trouble finding a solution integrating with html webpack plugin |
No stress, I'm not in a hurry but would be nice if we can get some kind of solution around this. Appreciate all the efforts. Thanks for the heads up anyways! |
That's actually the same problem I have:
|
I've forked your repo and reverted it back to use v3.2. Perhaps you have to hook into a different webpack event? hm... |
Just a thought, why this isn't working: Example: Perhaps the injection happens to late in the pipeline when parsing of the The I've too little knowledge about the innerworkings of webpack, more precisely I don't know what plugin/loader (or webpack itself at a certain stage?) does this parsing and processing exactly. That's what needs to be found out.
|
Yeah i think you're definitely right there, i've tried poking around some of the earlier stages but i couldn't seem to find one that i would be able to efficiently hook this plugin into. as far as forking and reverting, does the plugin work "as is" with a simple downgrade? wondering if i should release that on npm until i figure out a way to resolve this i don't have a ton of immediate time to look back into this, maybe by the weekend or next week after im through holiday travel it's also interesting as html-webpack-plugin v4 has been in beta for a very long time. not sure what their roadmap looks like in terms of re-adding any of this or completely changing the api again @Wouter125 if you need a solution still in the meantime, maybe you can try Legends' fork as well |
Referencing an issue I opened in the @colbyfayock I like the approach of your plugin. Unrelated to your plugin, but with But when I use the current We'll find a solution... To make it more clear, when using
|
thanks - that might help someone else running into this issue that needs a temporary fix the only thing that im worried about is that it was an intentional design decision for html-webpack-plugin and we may need to figure out a new solution. thanks for helping dig in on this |
Just a short update: We have to update the template to include the partials before the childCompiler runs Anyways, as said, Or we/you implement the logic on our own, but this requires deeper knowledge of the webpack engine. |
I've closed the issue in the Let's discuss all things there as I have made some suggestions how it can be solved. |
yeah - getting into the webpack specifics was where i was getting lost when i dug deep into this last time. thanks for getting that request out. im sensing a little pushback on it, but hopefully we can figure something out in some way whether it's with some first class functionality or a way forward here |
Sounds good. In the meanwhile I moved to gulp with a Webpack bundler inside the streams. Doing the partials through gulp and fixing the rest by using Webpack. That was an option that I still had luckily. So I no longer needed a fix for the issue here. Hope you guys can sort it out! Thanks for all the efforts. Really appreciated! |
Just wanted to give a heads up - haven't been able to find some more time to look at this and I'll be unavailable for the next ~2 weeks. Hopefully after that I can try to spend some more time thinking through this and getting it through the html-webpack-plugin compilation train. |
One way might be to 'import' assets using js. Then integrate it by DOM manipulation. |
@shariult if you're interested in giving it a shot, id be open to a PR :) |
okay, I will. Though I am little bit busy at the moment. I really like this project, so I will try to solve both issues. For now @Wouter125 , you can use this sort of a hack I use as a work around. See the image I uploaded, |
The problem still persits.... is there any solution or workaround? Thank you! |
i haven't been actively working on this, but i'd happily accept a pull request to get it fixed! |
Same problem here. Images' paths inside partials do not get procesed. Any solutions? |
For anybody else coming here, it looks like using |
Hi,
First of all thanks for this plugin, really loving it. There is just one issue, and I'm not sure whether it's related to this plugin or not, but let's see.
In my dev environment everything is working fine, and running perfectly. But when I try to compile it, all my paths inside the partials are not getting resolved correctly. They remain the same as they were in my dev environment.
My webpack config looks like this;
------PROD-------
sz-main-footer.html
;Any ideas how I can fix this? And let my image path inside a partial be correct when compiling? Or is this related to the html-loader? All images inside the HtmlWebpackPlugin page do work tho.
The text was updated successfully, but these errors were encountered: