Chord OMS
...
Developer Tools
Next.js

Developing

5min

Here are some common scripts that you'll use to work with Chord's Next.js starter kit. As with any Next.js site, you can customize the scripts in package.json , but we'll describe the defaults here.

Starting a development server

yarn
npm


Starts a Next.js server in development mode on http://localhost:3000. Hot reload is automatically enabled.

Running unit tests

yarn
npm


This starter uses Jest, and react-testing-library to test React components. Running the tests in watch mode will re-run the tests any time a code change is detected.

Building a production site

yarn
npm


Builds the site for production.

Starting a production server

yarn
npm


Starts a production Next.js server on http://localhost:3000.

Optimizing a production site

The starter kit comes with @next/bundle-analyzer , which generates a visualization of the site's Javascript bundles. This can be helpful for understanding and optimizing bundle size.

yarn
npm


Runs next build and also opens a browser window with an interactive visualization of bundles.

Updated 03 Mar 2023
Did this page help you?