Parcel: add content hash to html

Viewed 793

I have three files. loader.js would create an iframe that loads content.html which then loads content.js. I publish loader.js so other people can include it in their site, and content html and js are internal.

Now I want to add a content hash to content.html and content.js so I can add some agressive cache config to these files.

When I build html with parcel build content.html, I got content.html and content.<hash>.js. Is there a way to put build hash to content.html as well and also update loader.js to include hashed content.html url?

EDIT: I think I found it's impossible - there is open issue https://github.com/parcel-bundler/parcel/issues/4498

1 Answers

Never worked with parcel, but the documentation says:

Entrypoints are never hashed

So your content.html will not be hashed, because it is entrypoint: parcel build content.html

Related