GithubHelp home page GithubHelp logo

chlbri / bun-react-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ashirbadgudu/bun-react-app

0.0 0.0 0.0 163 KB

Create a react app with bun.js

Home Page: https://dev.to/ashirbadgudu/create-a-react-app-with-bun-125o

JavaScript 21.54% CSS 27.26% HTML 51.20%

bun-react-app's Introduction

React with Bun runtime

Want to use bun for your next react projects?


Install bun

First run the following command to check bun is installed or not

bun -v

If you don't have bun installed then run the following command to install bun

curl https://bun.sh/install | bash

Create a react app

Now run the following command to create a react app

bun create react [your-app-name]

It will create a new directory with the name of your app. To start the app run the following command

cd your-app-name
bun dev

Build production bundle for react app

By default bun does not ship with react-scripts so you need to install it first.

bun a react-scripts -d

Here we install it as a dev dependency.

Then run the following command to build the production bundle

bun react-scripts build

When you run the command above it will build the production bundle and it will be stored in the build directory.

Adding scripts to your package.json

We can add the following scripts to our package.json file

{
  "scripts": {
    "start": "bun dev",
    "build": "react-scripts build"
  }
}

Now we can run the following command to start the app

bun start

And we can run the following command to build the production bundle

bun run build

Bonus:

By default bun creates react app with javascript but we can easily use typescript by changing the file extension from .jsx to .tsx

bun-react-app's People

Contributors

ashirbadgudu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.