Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support injecting single static files into nitro public folder #13079

Closed
danielroe opened this issue Dec 20, 2021 · 1 comment
Closed

support injecting single static files into nitro public folder #13079

danielroe opened this issue Dec 20, 2021 · 1 comment

Comments

@danielroe
Copy link
Member

danielroe commented Dec 20, 2021

By default, we could add favicon.ico (1x1 transparent gif) and empty robots.txt if there's no explicit public/ folder. Modules might also want to inject other files (like sw.js).

In order to do this we need support within nitro for injecting single static files into the output.

addAsset('favicon.ico', ...)
addBuildAsset('icon.hash123.png')

See https://github.com/nuxt/framework/discussions/2294#discussioncomment-1756029.

@pi0
Copy link
Member

pi0 commented Apr 12, 2022

With nitro, we can add multiple publicAssets dirs with their prefix and directory.

Supporting individual and virtual public assets could be also a nice idea but I need more reasons to include it (feel free to open a discussion in nitro repo)

Also we have unjs/serve-placeholder that automatically handles cases such as favicon.ico, robots.txt and *.js (not found) (to be enabled for production as well via nitrojs/nitro#94)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants