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

De-experimentalize the public/ folder #8063

Closed
3 tasks done
Timer opened this issue Jul 22, 2019 · 4 comments · Fixed by #8661
Closed
3 tasks done

De-experimentalize the public/ folder #8063

Timer opened this issue Jul 22, 2019 · 4 comments · Fixed by #8661
Milestone

Comments

@Timer
Copy link
Member

Timer commented Jul 22, 2019

Before we shipped Next.js 9 we removed a canary-only feature that was the public/ folder.

We should reintroduce the public/ folder as a replacement for the static/ folder, along these guidelines:

  • Usage of the static/ folder should warn about deprecation and provide migration instructions (move static/ to public/, i.e. public/static/)
  • Commands like next build and next export should forbid output into the public/ directory (i.e. distDir and out dir)
  • Assets served from the public/ folder should have a default mime type applied (e.g. mime.getType(fileExt))
@Timer Timer added this to the 9.1 milestone Jul 22, 2019
@haywirez
Copy link

haywirez commented Aug 2, 2019

This would pose a small problem for Gitlab pages - they require your out/dist dir to be /public. You could work around by renaming the folder with scripts, but still.

@Timer
Copy link
Member Author

Timer commented Aug 2, 2019

@haywirez the public directory is copied elsewhere on next export, meaning this would work fine.

@dzmitry-lahoda
Copy link

https://github.com/zeit/next.js/blob/master/errors/static-dir-deprecated.md

https://stackoverflow.com/questions/45505610/gitlab-pages-deployment-step-fails-after-successfull-build

"build": "next build && next export && cp -r out public",

Any proper solution without git bloat into public folder?

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants