brunocodutra / webapp-webpack-plugin

[DEPRECATED] use favicons-webpack-plugin instead
https://www.npmjs.com/package/webapp-webpack-plugin
MIT License
125 stars 17 forks source link

allow outputted file name to include prefix #145

Open o2dazone opened 6 years ago

o2dazone commented 6 years ago

Coming from favicons-webpack-plugin, the prefix configuration key allowed us to prepend the filename with a file hash. This let us, from a glance, determine if the favicons were properly cachebusted, but it also allowed us to dump multiple versions of a favicon into the same S3 assets directory. The application I'm building is multi-tenant, so these versions may differ drastically. Is there any desire to support an extra key or an ability to hash filenames on export?

favicons-webpack-plugin dist/assets/abc123-favicon.png dist/assets/xyz456-favicon.png

webapp-webpack-plugin dist/assets/xyz456/favicon.png dist/assets/abc123/favicon.png

brunocodutra commented 6 years ago

webapp-webpack-plugin doesn't support this because favicons itself doesn't.

favicons-webpack-plugin attempted to work around this limitation using a naive regex that fails to fix the various manifest files and also some html meta tags that contain references to files in attributes other than href, essentially producing broken output. I attempted to put together a more sophisticated regex to cover all edge cases in the past, but I eventually realized that this was just bad engineering and decided to remove this [mis]feature until it's supported upstream.

Patching favicons certainly isn't too difficult, I just never got to find the time to do it. If you don't mind, I'll leave this issue open as a reminder.