未验证 提交 90015e35 编写于 作者: L Luis Alvarez D 提交者: GitHub

Update note about public and pages overlap (#10287)

* Updated note about public and pages overlap

* Update static-file-serving.md

* Update static-file-serving.md
Co-authored-by: NJoe Haddad <timer150@gmail.com>
上级 e35005c2
......@@ -16,6 +16,10 @@ function MyImage() {
export default MyImage
```
> Don't name the `public` directory anything else. The name can't be changed and is the only directory that **Next.js** uses to serve static assets.
This folder is also useful for `robots.txt`, Google Site Verification, and any other static files (including `.html`)!
> If you ever add a static asset that conflicts with the name of a page in the `pages` directory, the public file will be ignored in favor of the file in `pages`.
> **Note**: Don't name the `public` directory anything else. The name cannot be changed and is the only directory used to serve static assets.
> **Note**: Be sure to not have a static file with the same name as a file in the `pages/` directory, as this will result in an error.
>
> Read more: <http://err.sh/next.js/conflicting-public-file-page>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册