atlaschiew / react-study

happy reacting
0 stars 0 forks source link

create-react-app and react-scripts #5

Open atlaschiew opened 1 year ago

atlaschiew commented 1 year ago

react-scripts is a set of scripts from the create-react-app starter pack. create-react-app helps you kick off projects without configuring, so you do not have to setup your project by yourself.

react-scripts start sets up the development environment and starts a server, as well as hot module reloading. You can read here to see what everything it does for you.

with create-react-app you have following features out of the box.

atlaschiew commented 1 year ago

shortly, react-script configures webpack to use babel on code compilation.

image

atlaschiew commented 1 year ago

without create-react-app and react-scripts, you can also try to configure them from scratch following this article.

https://javascript.plainenglish.io/webpack-and-babel-setup-with-react-from-scratch-bef0fe2ae3e7

atlaschiew commented 1 year ago

react with js

npx create-react-app cra-js

react with ts

npx create-react-app cra-ts --template typescript