Here in this post lies the steps you can take to quickly setup a React project with Bun.
First we need to install bun with this command:
curl -fsSL https://bun.sh/install | bash
Once it has successfully installed you should see something like this:
Don’t forget to run the command shown (Replace {username} with your username).
source /home/{username}/.bashrc
Now you should be able to use the ‘bun‘ command without getting any error.
To create your app there are two ways.
1. Create React App
2. Vite
Using Create React App
Simply run the command below –
bun create react-app your-app-name
Using Vite
After running the command below, you’ll be prompted to select some options specific to the type of project you’re trying to create.
bun create vite
Once you’re done, navigate to your project directory then start your react app using bun by executing the following commands:
cd my-app
bun start
I’m so glad you got to this point :). Happy baking Chifu!