This section applies not only to React projects but to any web project!
Using npm init -y
On a new folder, e.g. reactjon
, we will enter this following command on Terminal:
This creates a file named package.json
that describes our new web app:
We can do a few modifications:
Updating the entry point
We update the main
property from index.js
to src/index.js
to keep our files more organized!
Adding npm run
scripts
npm run
scriptsWe then include our npm run
scripts which allow us to run a local version of our app (webpage)!
Adding browserslist
browserslist
The browserslist
property just excludes any ancient browsers like Internet Explorer!
Last updated