8ae08b94d8
Proposes fix to #33110 Adds info on environment variables and the /src folder in the following docs: - https://nextjs.org/docs/advanced-features/src-directory - https://nextjs.org/docs/basic-features/environment-variables#loading-environment-variables ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [x] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint` Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
884 B
884 B
description |
---|
Save pages under the `src` directory as an alternative to the root `pages` directory. |
src
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.
Caveats
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
Related
For more information on what to do next, we recommend the following sections: