-
create a folder with the name of the application
-
yarn init in the workspace
-
yarn add webpack webpack-cli -D
-
create a src folder in the workspace and add index.js file in the folder
-
add
"scripts": { "start": "webpack --mode development", "build": "webpack --mode production" }
in package.json
-
yarn start
-
yarn build
-
Set up react and babel
-
yarn add react react-dom
-
yarn add babel-core babel-loader babel-preset-env babel-preset-react -D
-
create webpack.config.js file
-
then create .babelrc to provide options for the babel-loader
-
create index.html in src folder
-
yarn add html-webpack-plugin -D
-
use html-webpack-plugin in webpack.config.js
-
yarn start; see index.html created in dist folder and if you open it you can see hello world in browser