coding-to-music / coding-to-music.github.io

https://pandemic-overview.readthedocs.io/en/latest/index.html
MIT License
2 stars 8 forks source link

React Webpack Babel Starter - Minimal starter with hot module replacement (HMR) for rapid development. #153

Open coding-to-music opened 3 years ago

coding-to-music commented 3 years ago

https://github.com/vikpe/react-webpack-babel-starter https://github.com/coding-to-music/react-webpack-babel-starter

React Webpack Babel Starter

Minimal starter with hot module replacement (HMR) for rapid development.

Installation

  1. Clone/download repo
  2. yarn install (or npm install for npm)

Usage

Development

yarn run start-dev

Production

yarn run start-prod

Note: change port number by setting the envrionment variable PORT


All commands

Command Description
yarn run start-dev Build app continously (HMR enabled) and serve @ http://localhost:8080
yarn run start-prod Build app once (HMR disabled) to /dist/ @ http://localhost:3000
yarn run build Build app to /dist/
yarn run test Run tests
yarn run prettier-write Format code and write changes
yarn run prettier-check Prints the filenames of files that are different from Prettier formatting
yarn run start (alias of yarn run start-dev)

Note: replace yarn with npm in package.json if you use npm.

See also

coding-to-music commented 3 years ago

yarn install

root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/react-webpack-babel-starter# yarn install
yarn install v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @hot-loader/react-dom@17.0.1" has incorrect peer dependency "react@17.0.1".
warning "@wojtekmaj/enzyme-adapter-react-17 > react-test-renderer@17.0.1" has incorrect peer dependency "react@17.0.1".
[4/4] Building fresh packages...
Done in 230.80s.

yarn run start-dev

root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/react-webpack-babel-starter# yarn run start-dev
yarn run v1.22.10
$ webpack serve --config=configs/webpack/dev.js
ℹ 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /root/ap/react-webpack-babel-starter
ℹ 「wdm」: wait until bundle finished: /
ℹ 「wdm」: asset main.js 1.59 MiB [emitted] [big] (name: main) 1 related asset
asset img/5b197262b6f2d51239cafdfbc6bb0487.svg 2.55 KiB [emitted] [immutable] [from: assets/img/react_logo.svg] (auxiliary name: main)
asset index.html 617 bytes [emitted]
runtime modules 27.1 KiB 16 modules
modules by path ../node_modules/ 1.47 MiB 60 modules
modules by path ./ 18 KiB
  modules by path ./components/*.jsx 14.6 KiB
    ./components/App.jsx 5.17 KiB [built] [code generated]
    ./components/AboutPage.jsx 4.65 KiB [built] [code generated]
    ./components/WelcomePage.jsx 4.79 KiB [built] [code generated]
  modules by path ./assets/ 2.41 KiB
    ./assets/scss/App.scss 1.42 KiB [built] [code generated]
    ../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./assets/scss/App.scss 922 bytes [built] [code generated]
    ./assets/img/react_logo.svg 84 bytes [built] [code generated]
  ./index.js 970 bytes [built] [code generated]
external "React" 42 bytes [built] [code generated]
webpack 5.38.1 compiled successfully in 11631 ms
ℹ 「wdm」: Compiled successfully.
^C