Webpack 5 boilerplate using React, TypeScript, Babel 7, PostCSS and Sass with a hot dev server and an optimized production build. Babel compiles TypeScript to ES5. The Webpack plugin fork-ts-checker-webpack-plugin does the type checking. It is possible to use both React with JS in .jsx files and React with TS in .tsx files. Except from the main index.js and the webpack files the modules are ready in jsx and tsx.
- Make sure you have a new version of Node installed
- Download the code by zip or fork
- Run the command npm install by the command promt
- npm run start
- You can view the development server at
localhost:8080
.
- npm run build
- npm run prod
react
- React is a JavaScript library for creating user interfaces. For creating React components.react-dom
- This package serves as the entry point to the DOM and server renderers for React.react-router-dom
- This package serves as DOM for React Router.react-hook-form
- Forms in Reack.
@babel-runtime
- Babel Runtime for dev babel/plugin-transform-runtime.
core-js
- Main Library with polyfills for older Browserswhatwg-fetch
- For making promise based web request progammitically
typescript
- TypeScript by NPM@babel/preset-typescript
- Babel TypeScript@types/react
- Typechecking React@types/react-dom
- Typechecking React Dom
webpack
- Module and asset bundler.webpack-cli
- Command line interface for webpackwebpack-dev-server
- Development server for webpackwebpack-merge
- Simplify dev/prod configuration
babel-loader
- Transpile files - Babel/webpacksass-loader
- Load SCSS and compile to CSSnode-sass
- Node Sasspostcss-loader
- Process CSS with PostCSSpostcss-preset-env
- Default for PostCSScss-loader
- Resolve CSS importsstyle-loader
- Inject CSS into the DOM
@babel/core
- Transpile ES6+ to ES5@babel/preset-env
- Smart defaults for Babel@babel/preset-react
- Defaults Babel React@babel/plugin-transform-runtime
- Babel to use async/await@babel/plugin-proposal-object-rest-spread
- Babel helper@babel/plugin-transform-arrow-functions
- For arrow functions@babel/plugin-transform-async-to-generator
- Generator for async/await@babel/plugin-proposal-class-properties
- Use properties on a class
fork-ts-checker-webpack-plugin
Handles the TypeScript type checkingclean-webpack-plugin
- Remove/clean build folderscopy-webpack-plugin
- Copy files to build directoryhtml-webpack-plugin
- Generate HTML files from templatemini-css-extract-plugin
- Extract CSS into separate filescss-minimizer-webpack-plugin
- Optimize and minimize CSS assetscross-env
- Cross platform configurationpath
- Node Path moulehttp-server
- HTTP server for testing the produktion build by running npm run prod
- Per Olsen
This project is open source and available under the MIT License.