Our Commitment to Open Source can be found here
- Fork this repository to your own GitHub account and then clone it to your local device.
- Install yarn:
npm install -g yarn
- Install the dependencies:
yarn
- Run
yarn dev
to build and watch for code changes - In a new terminal, run
yarn types
to compile declaration files from TypeScript - The development branch is
canary
. On a release, the relevant parts of the changes in thecanary
branch are rebased intomaster
.
You may need to run
yarn types
again if your types get outdated.
Running all tests:
yarn testonly
Running a specific test suite inside of the test/integration
directory:
yarn testonly --testPathPattern "production"
Running just one test in the production
test suite:
yarn testonly --testPathPattern "production" -t "should allow etag header support"
The correct path to the compiled next
binary can be discovered by running:
find . -name next -perm -u=x -type f
Running examples can be done with:
./packages/next/dist/bin/next ./test/integration/basic
# OR
./packages/next/dist/bin/next ./examples/basic-css/
To figure out which pages are available for the given example, you can run:
EXAMPLE=./test/integration/basic
(\
cd $EXAMPLE/pages; \
find . -type f \
| grep -v '\.next' \
| sed 's#^\.##' \
| sed 's#index\.js##' \
| sed 's#\.js$##' \
| xargs -I{} echo localhost:3000{} \
)
-
In your app's
package.json
, replace:"next": "<next-version>",
with:
"next": "file:<local-path-to-cloned-nextjs-repo>/packages/next",
-
In your app's root directory, make sure to remove
next
fromnode_modules
with:rm -rf ./node_modules/next
-
In your app's root directory, run:
yarn
to re-install all of the dependencies.
Note that Next will be copied from the locally compiled version as opposed to from being downloaded from the NPM registry.
-
Run your application as you normally would.
-
To update your app's dependencies, after you've made changes to your local
next
repository. In your app's root directory, run:yarn install --force