Summarised [from this at jsramblings](https://jsramblings.com/creating-a-react-app-with-webpack/) Full code [on his github](https://github.com/jsramblings/react-webpack-setup) ``` mkdir react-webpack cd react-webpack npm init -y ``` ``` mkdir public cat >| public/index.html < React + Webpack

Hello React + Webpack!

END ``` ``` npx serve public ``` ## Adding webpack ``` npm install webpack webpack-cli --save-dev ``` ``` mkdir src touch src/index.js cat >| src/index.js < webpack.config.js < webpack.config.js < .babelrc <

Hello from React!

; export default Hello; ``` add to main app file ``` // index.js import React from "react"; import { createRoot } from "react-dom/client"; import Hello from "./Hello"; const container = document.getElementById("root"); const root = createRoot(container); root.render(); ``` add to `index.html` ```html
``` ``` npm run start ``` ``` npm run build npx serve build ```