nitro
nitro copied to clipboard
feature: Add an utility to add assets to routes
Describe the feature
Currently we can add public assets directories but not individual files which seems straight forward to add improving DX along the way.
My suggestion is creating a addPublicAsset(pathToAFile)
, would be interesting to support public asset hashing at build time too:
- If I do a fetch in my application for
/something/publicAsset.png
it coud be doable to replace this string in build time with an hashing file like/something/32eqedqdqw.publicAsset.png
but I really could be seeing it wrongly here!
Use case:
- I need a way to add public assets without creating a temporary dir each time and hashing it based on the content.
- I am creating a way to dynamically import tailwind css file in nuxt/tailwind module and need a pratical way to add the new asset in a nuxt module and hash it if possible.
Additional information
- [x] Would you be willing to help implement this feature?