Max*_*cki 13 javascript reactjs next.js
The Next.js documentation states, that the directory src/pages
is an alternative to /pages
. However, my custom _app.tsx
and _document.tsx
files, get ignored when the pages folder is moved into src.
You can recreate this issue yourself, when creating an empty Next.js App, moving the pages folder into src and updating the import paths of the css files. The content of the index.tsx
file will still be rendered, but modifications to the styles/globals.css
, which is imported in the _app.tsx
will have no effect.
It is impossible to have a pages folder inside of src and outside of src at the same time, therefore preventing me to use src/pages
in any app which needs a modificaton to the _app.tsx
or _document.tsx
.
Am I missing an important part of the documentation or does this work as intended?
jul*_*ves 21
更改项目文件夹结构或添加新的_app
/_document
文件有时会导致缓存问题。
删除该.next
文件夹并重新启动开发服务器,以确保 Next.js 完成的任何缓存不会妨碍。
归档时间: |
|
查看次数: |
3033 次 |
最近记录: |