5 Feb 2025・1 Minutes reading
Bun is a fast JavaScript runtime that offers a great alternative to Node.js, with built-in support for package management and script execution. In this guide, we will set up a fresh Next.js 15 project and run it using Bun.
Before we begin, make sure you have the following installed:
curl -fsSL https://bun.sh/install | bash
)Run the following command to create a new Next.js 15 project:
bun create next@latest my-next-app
Navigate into the project directory:
cd my-next-app
Bun can install dependencies much faster than npm or yarn. Simply run:
bun install
This will install all necessary dependencies for your Next.js 15 project.
To start the Next.js development server using Bun, run:
bun dev
Your Next.js app should now be running at http://localhost:3000
.
To build the project, run:
bun run build
Then, start the production server:
bun run start
Using Bun with Next.js 15 provides a faster development experience, thanks to Bun's speed and efficient package management. If you're looking to optimize your Next.js workflow, give Bun a try!
Happy coding! 🚀
Recommendation
You might like this post