Skip to content

Instantly share code, notes, and snippets.

@developit
Last active November 7, 2019 03:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save developit/0aa0c7bb02491bb6ccf362c2bafead15 to your computer and use it in GitHub Desktop.
Save developit/0aa0c7bb02491bb6ccf362c2bafead15 to your computer and use it in GitHub Desktop.
Test a local copy of Next.js against apps

Given a directory structure like the following:

📂projects
  📂next    <-- your Next.js checkout
  📂demo-app

Here's how to build your local copy of Next.js. You'll want to do this every time you make a change to Next itself.

cd next
yarn prepublish

You can also try yarn dev to set up automatic rebuilding when making changes (though I've had trouble with this).

cd demo-app

# to run a build:
(cd ../next && yarn run next build ../demo-app)

# to run start a production server:
(cd ../next && yarn run next start ../demo-app)

# to start the development server:
(cd ../next && yarn run next ../demo-app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment