This read note is for first time npm installation
Created a new folder with name "react-firstapp"
npm command to initialize this new app
npm init
Npm command to install react dependencies and save it in package.json file
npm install react react-dom react-jsx --save
Npm command to install react Dev Dependencies and save in package.json file.
npm install babel-core babel-loader babel-preset-es2015 babel-preset-react babel-preset-stage-2 webpack webpack-dev-server --save-dev
Inside the root application directory, manually create below files and folders
- react-firstapp/webpack.config.js (file)
- react-firstapp/src (Folder)
- react-firstapp/src/index.html (file)
- react-firstapp/src/app (Folder)
- react-firstapp/src/app/index.js (file)
Take the reference and update webpack.config.js
For package.json, update the auto generated scripts notation with below
"scripts": {
"start": "npm run build",
"build": "webpack -d && xcopy "src/index.html" "dist/" /F /Y && webpack-dev-server --content-base src/ --inline",
"build:prod": "webpack -p && xcopy "src/index.html" "dist/" /F /Y"
}