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

Auto add <rootDir>/public/ as public dir if it exists #2924

Open
tguelcan opened this issue Dec 5, 2024 · 2 comments
Open

Auto add <rootDir>/public/ as public dir if it exists #2924

tguelcan opened this issue Dec 5, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@tguelcan
Copy link

tguelcan commented Dec 5, 2024

Environment

node v.23.1.0

Reproduction

https://stackblitz.com/edit/github-dyuiz1?file=public%2Flogo.svg

Describe the bug

public assets are no longer copied when building
.output/public/ remains empty

Additional context

This is also not possible with a new nitro project.

Logs

No response

@tguelcan tguelcan changed the title public assets are empty public assets are empty after build Dec 5, 2024
@pi0
Copy link
Member

pi0 commented Dec 5, 2024

When srcDir points to server/ you need to put all sources into server/ directory, including server/public.

I will convert issue to an enhancement since it might be more ergonomic to auto add top level public dir but it is not current expectation.

@pi0 pi0 added enhancement New feature or request and removed pending triage labels Dec 5, 2024
@pi0 pi0 changed the title public assets are empty after build Auto add <rootDir>/public/ as public dir if it exists Dec 5, 2024
@tguelcan
Copy link
Author

tguelcan commented Dec 6, 2024

Thanks @pi0 . I followed the documentation. Perhaps this should be updated as it shows that the public folder is in the root by default.

public/
  image.png     <-- /image.png
  video.mp4     <-- /video.mp4
  robots.txt    <-- /robots.txt
package.json
nitro.config.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants