How to Covert Your Webpack HTML Project to React without Using Create-React-App
Feb 25, 2022
To convert your WebPack or HTML project to React is actually pretty simple:
- You need install
react-scripts
dependency. Make sure it isreact-scripts
instead ofreact-script
, mind the “s” to prevent the typo issue. - Make sure you have
public
folder withindex.html
file and andsrc
folder withindex.js
file. - Add start script with: `“start”: “react-scripts start”`.
As now, you can run the script by using yarn start
to boot your application.
The good thing about using react-scripts
instead of create-react-app
is that you can minimize the effort on moving files arounds. Plus, react-scripts
is actually hot load build in, so you don’t need config complex config file.