11ty / eleventy-plugin-bundle

Little bundles of code, little bundles of joy.
71 stars 3 forks source link

Add bucket name as prefix of the bundle filename #21

Open nhoizey opened 7 months ago

nhoizey commented 7 months ago

A project in which I use this plugin currently generates two JavaScript bundles, for two buckets:

I would like to include only one of them in my Service Worker precaching, but the filename doesn't really help configuring the Service Worker build with a glob (I'm using Workbox).

It would be great if the bundle filename could include the bucket name as bucket-name_hash.js, which in my current use case would be:

cssandstuff commented 3 months ago

I'd also like something similar to this feature. The ability to just name your bundles so that they can be a consistent url. For example I might want to split my css for convenience-sake (locality of behaviour) but eagerly load a css bundle on the root or other template, but I can't do that if the bundle name always changes.