description |
---|
Save pages under the `src` directory as an alternative to the root `pages` directory. |
Pages can also be added under src/pages
as an alternative to the root pages
directory.
The src
directory is very common in many apps and Next.js supports it by default.
src/pages
will be ignored ifpages
is present in the root directory- Config files like
next.config.js
andtsconfig.json
, as well as environment variables, should be inside the root directory, moving them tosrc
won't work. Same goes for thepublic
directory
For more information on what to do next, we recommend the following sections: