TylorS / typed-content-hash

Rewrite your HTML/JS/CSS (and sourceMap!) files with SHA-512 content hashes
12 stars 3 forks source link

Support for {Shared)Workers? #17

Open pusewicz opened 3 years ago

pusewicz commented 3 years ago

Hi!

I've got this kind of code:

const workerUrl = new URL('./worker.js', import.meta.url)

and unfortunately it does not get detected and hashed. How would I go around making this happen?

TylorS commented 3 years ago

Hey @pusewicz, sorry things aren't quite working as expected. At present, I haven't added support for URL but it does seem like something that should be possible and desirable, it'll probably be similar to service worker support.

Side thought: I'm starting to think we should have the ability to customize more without making changes directly to this library.

pusewicz commented 3 years ago

FWIW, I've added a custom plugin for snowpack that does the search and replace manually by looking at the manifest file, as the worker file does get hashed. Feel free to close this issue if you don't feel like spending time on it. Thanks!