DEV Community

Sony AK
Sony AK

Posted on

How to use React without build steps

Why React without build steps? Why not. Sometimes we are boring with doing npm install bla bla bla. Let's doing React like jQuery things, just use CDN and run hahaha.

Let's start.

Just go to https://github.com/sonyarianto/react-without-buildsteps

There is single index.html file there and without build steps means we just use CDN version for all of our React operation. That's includes the router and the Babel to handle the JSX code.

Here is the CDN URLs that used on that projects.

<script src="https://cdn.jsdelivr.net/npm/react@18.2.0/umd/react.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/react-dom@18.2.0/umd/react-dom.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@remix-run/router@1.6.2/dist/router.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/react-router@6.11.2/dist/umd/react-router.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/react-router-dom@6.11.2/dist/umd/react-router-dom.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@babel/standalone@7.22.4/babel.min.js"></script>
Enter fullscreen mode Exit fullscreen mode

and then finally the demo is on

https://react-without-buildsteps.vercel.app/

I hope you enjoy it.

Top comments (2)

Collapse
 
9opsec profile image
9opsec

Pretty cool. This will be useful in a situation where someone can't install npm.

Collapse
 
sonyarianto profile image
Sony AK

true, and just to share about React from different perspective.