-
Install dependencies
pnpm install
-
Format code
pnpm format
-
Typecheck code
pnpm tsc
-
Lint code
pnpm lint
-
Build code
pnpm build
-
Run code in development mode
pnpm dev
-
Run code in production mode
pnpm start
Debugging in Visual Studio Code is supported and has great developer experiences, e.g. breakpoints, logpoints, data inspection, etc.
See Develop for specific instructions on how to debug various scenarios in Visual Studio Code.
Note
Due to lazy compilation, Visual Studio Code may temporarily display Unbound breakpoint icons in source files until they are successfully compiled.
Instead of running pnpm dev
in CLI, developing in Visual Studio Code is supported and has better developer experiences.
To develop in Visual Studio Code:
-
Select the Run and Debug icon in the Activity Bar navigation
-
Select the Next.js option in the Run and Debug dropdown
-
Click the Start Debugging button
Visual Studio Code will automatically start the Next.js development server and open the Next.js development URL in Google Chrome for debugging.
Important
If Google Chrome is running, it must be quit (Command/Ctrl+Q
) before it can be opened for debugging.
Instead of running scripts in CLI, running scripts in Visual Studio Code is supported and has better developer experiences.
To run scripts in Visual Studio Code
-
Open the Command Pallete (
Command/Ctrl+Shift+P
) -
Filter on Run Task to see various task-related commands:
- Tasks: Run Build Task - Run build script
- Tasks: Run Test Task - Run test script
- Tasks: Run Task - Run script (
pnpm format
,pnpm lint
, etc.)