chialab / rna

🚀 Build tools for modern web modules and applications.

Home Page:https://chialab.github.io/rna/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

esbuild-plugin-html does not use the original directory of the source file

maartenst opened this issue · comments

I'm trying to use esbuild-plugin-html with the esbuild-plugin-glob plugin to use it with several html files, like this:
[ "pages/**/*.html", "dynamic_pages/**/*.html"];

This breaks as the code now just uses the filename and not the directory. I hacked it to work by changing the creation of the finalOutputFile const in the index.js around line 28595 to this:
const finalOutputFile = `${workingDir}/${outDir}/${inputs[0]}`;

I'm not making a PR as I have a hard time understanding the original way of setting the path and what else in the code it affects but maybe you can have a look and adjust it so it does take the path into account?

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Hello @maartenst! Thanks for reporting!

The issue should be resolved in the latest version of the plugin. If you still notice any problems, feel free to reopen the issue.

Hi @edoardocavazza ,unfortunately it does not seem to work yet; I do see directories being created e.g. within 'dynamic_pages' but I still only have one resulting html file in the root of the dist dir, so it seems like the files aren't using the directory they are read from as a target to write to but just overwrite the one in the root of the dist target dir. Also I can't reopen this issue, can you or should I create a new one?

any progress on this?

Hi @maartenst, I am sorry for the delay, I really wanted to fix this but haven't time yet. It would be very helpful for me to have a reproduction repository to test out 🙏

ok, I'll create one as soon as I have time, sometime this week probably, thanks!