Chord OMS
...
Next.js
Developing
5 min
here are some common scripts that you'll use to work with https //github com/chordcommerce/nextjs starter performance as with any next js site, you can customize the scripts in package json https //github com/chordcommerce/nextjs starter performance/blob/main/package json#l5 l15 , but we'll describe the defaults here starting a development server yarn yarn dev npm npm run dev starts a next js server in development mode on http //localhost 3000 hot reload is automatically enabled running unit tests yarn yarn test # runs all tests yarn test\ watch # runs all tests in watch mode npm npm test # runs all tests npm run test\ watch # runs all tests in watch mode this starter uses https //jestjs io/ , and https //github com/testing library/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 yarn build npm npm run build builds the site for production starting a production server yarn yarn start npm npm start starts a production next js server on http //localhost 3000 optimizing a production site the starter kit comes with @next/bundle analyzer https //www npmjs com/package/@next/bundle analyzer , which generates a visualization of the site's javascript bundles this can be helpful for understanding and optimizing bundle size yarn yarn analyze npm npm run analyze runs next build and also opens a browser window with an interactive visualization of bundles