feature: Add an utility to add assets to routes
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 899
- Avg merge
- 2d 24m
- Merged PRs (30d)
- 40
Description
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.pngit coud be doable to replace this string in build time with an hashing file like/something/32eqedqdqw.publicAsset.pngbut 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
- Would you be willing to help implement this feature?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin by locating the existing public-assets directory handling and the route/build entry points that register those assets. Compare the current behavior with the proposed addPublicAsset(pathToAFile) API and determine how optional build-time hashing should be covered by tests. Done means individual assets can be added without a temporary directory, with the agreed hashing behavior documented and verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- tailwindcss, typescript
- Domain
- api, backend, build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100