Skip to content

piotrlewandowski/webpack-5-react-starter

Repository files navigation

Webpack 5 React Starter

Simple Webpack 5 React Starter. It contains:

  • React 17.0.2
  • Latest Webpack 5 (v5.58.1) and Webpack Dev Server 4 (v4.13.1) with Scope Hoisting enabled
  • Babel 7
  • ECMAScript 6+ and JSX support
  • Hot Module Replacement
  • Production config
  • Export separate vendor and runtime files
  • Sass/SCSS support
  • Separate CSS stylesheets generation
  • ES6 linting with continuous linting on file change
  • Stylelint
  • Prettier
  • Linting files and commit messages on commit
  • SVG and image files support
  • Commitizen
  • Automated versioning and CHANGELOG generation
  • Webpack Bundle Analyzer

Prerequisites

  • Node (Make sure you have the node 12+ installed)

Getting Started

  1. Clone the repository gh repo clone piotrlewandowski/webpack-5-react-starter (or if you're not using GitHub CLI: git clone git@github.com:piotrlewandowski/webpack-5-react-starter.git)
  2. If you're using NVM run nvm use inside project directory to use node version set in .nvmrc file
  3. Run npm install or npm i to install all the dependencies
  4. To begin development task, run npm start
  5. Open http://localhost:8080

Available commands

  • npm clean - delete the dist folder
  • npm start - start the dev server and watch for changes
  • npm run build - create a production ready build in dist folder
  • npm run profile - generate interactive treemap visualization of the contents of the bundle
  • npm run eslint:check - execute eslint check
  • npm run eslint:fix - execute eslint check and automatically fix problems
  • npm run stylelint:check - execute stylelint check
  • npm run stylelint:fix - execute stylelint check and automatically fix problems