This repo is a collection of my "default" webpack configuration for React applications.
- Build production bundles with
yarn build-prod
- Build development bundles with
yarn build-dev
- Run the development server with
yarn dev
- Run the development server with
- Build bundles to inspect the webpack config with
yarn build-none
This configuration has the following features:
- TypeScript & ES2016
- React/JSX
- Sass
- CSS modules
- The CSS filename hashing scheme assumes that all modules will be placed in
a directory sharing the name of the component. You can look at
App
for an example. TheApp.tsx
module andApp.scss
file are both in a directory namedApp
. As a result, the CSS classes are scoped something likesrc-components-App-header__[hash]
, but the App in the scope comes from the directory.
- The CSS filename hashing scheme assumes that all modules will be placed in
a directory sharing the name of the component. You can look at
- Splits vendor libraries out into their own bundle in production.