Based on: https://github.com/theodorusclarence/ts-nextjs-tailwind-starter
It is encouraged to use pnpm.
pnpm install
You can start the server using this command:
pnpm dev
Open http://localhost:3000 with your browser to see the result. You can start editing the page by modifying src/app/page.tsx
.
This project uses pnpm
for managing various development tasks. Below is a description of the scripts available in the package.json
file.
- Command:
next dev
- Description: Starts the Next.js application in development mode. It includes hot-reloading, so changes in your code will be automatically reflected in the browser.
- Command:
NEXT_OUTPUT_MODE=standalone NODE_OPTIONS=--max_old_space_size=8192 next build
- Description: Builds the Next.js application for production deployment. It creates a standalone version with an increased memory limit (
--max_old_space_size=8192
) to handle larger build processes.
- Command:
next start
- Description: Launches the Next.js application in production mode. Use this after building your app with
pnpm build
.
- Command:
next lint
- Description: Runs the Next.js built-in linter to check for code quality issues in your project.
- Command:
eslint src --fix && pnpm format
- Description: Automatically fixes linting issues in your source code (
src
directory) and then formats the code using Prettier.
- Command:
eslint --max-warnings=0 src
- Description: Runs ESLint on the source code with a strict configuration that treats warnings as errors.
- Command:
NODE_OPTIONS=--max_old_space_size=8192 tsc --noEmit --incremental false
- Description: Performs a TypeScript type check on your codebase without emitting any output, and with an increased memory limit. Disables incremental compilation for a full type-check.
- Command:
jest --watch
- Description: Runs tests in watch mode using Jest. This mode reruns tests related to changed files automatically.
- Command:
jest
- Description: Executes all tests once using Jest.
- Command:
prettier -w .
- Description: Formats all files in the project according to Prettier configuration.
- Command:
prettier -c .
- Description: Checks if files in the project are formatted according to Prettier's rules.
- Command:
next-sitemap --config next-sitemap.config.js
- Description: Generates a sitemap for the Next.js application using the
next-sitemap
tool with the specified configuration file.
- Command:
husky install
- Description: Installs Husky, which is used to manage Git hooks in your project. This ensures that certain scripts (like linters, formatters, or tests) are run before commits are made.