nitro icon indicating copy to clipboard operation
nitro copied to clipboard

Assets file cannot be copied to output public directory

Open j10ccc opened this issue 1 year ago • 1 comments

Environment

  • nitro: 2.9.7
  • node: 18.19.0

Reproduction

https://codesandbox.io/p/github/unjs/nitro/csb-jx28lh/draft/distracted-wing

Describe the bug

I read the document Assets part. When I create the public folder in repo root directory(exists package.json),and run build command, assets will not be copied into .output/public. However, I tried to move the public directory to srcDir defined in nitro.config.ts, it works.

So it is a feature or a misleading of document?

Additional context

No response

Logs

No response

j10ccc avatar Oct 08 '24 11:10 j10ccc

I'll update this doc part with #2775

geromegrignon avatar Oct 09 '24 07:10 geromegrignon

You should use server/public when srcDir is set to server currently.

In the future, we might also auto add top level public to be similar to Nuxt (#2924)

pi0 avatar Jan 07 '25 19:01 pi0