Minimal starter kit with hot module replacement (HMR) for rapid development and CSS Modules. Bbased on Viktor Persson's react-webpack-typescript-starter.
- React (16.x) with
- Webpack (3.x)
- Typescript (2.x)
- Hot Module Replacement (HMR) using React Hot Loader (3.x)
- CSS Modules and cssnext
- Babel (6.x)
- typed-intl for TypeScript friendly internationalization
- typed-redux-actions to avoid poilerplate when defining Redux actions
- immutable
- Jest - Testing framework for React applications with Enzyme
- Support for absolute import paths so that you can use
import ... from 'common/MyClass'
instead of relative../../common/MyClass
. - Production build script
- Image loading/minification using Image Webpack Loader
- Typescript compiling using Awesome Typescript Loader (3.x)
- Code quality (linting) for Typescript.
- Clone/download repo
npm install
(I prefer yarn which works fine as well)
Development
npm start
- Build app continously (HMR enabled)
- App served @
http://localhost:3000
Production
npm run start-prod
- Build app once (HMR disabled)
- App served @
http://localhost:3000
All commands
Command | Description |
---|---|
npm run start |
Alias for npm run start-dev |
npm run start-dev |
Build app continuously (HMR enabled) and serve @ http://localhost:3000 |
npm run start-prod |
Build app once (HMR disabled) and serve @ http://localhost:3000 |
npm run build |
Build app to /dist |
npm run test |
Run tests continuously watching for changes |
npm run test-coverage |
Run tests once with coverage |
npm run lint |
Run TypeScript linter |
npm run start |
(alias of npm run start-dev ) |
npm run css-types |
Builds TypeScript type declarations for CSS modules |