https://github.com/soelinn/react-ts-starter
https://github.com/soelinn/react-ts-starter
react-typescript-boilerplate starter-template webpack-config
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/soelinn/react-ts-starter
- Owner: soelinn
- Created: 2017-03-30T04:19:41.000Z (over 8 years ago)
- Default Branch: develop
- Last Pushed: 2023-01-03T15:25:20.000Z (almost 3 years ago)
- Last Synced: 2025-04-09T23:54:25.964Z (9 months ago)
- Topics: react-typescript-boilerplate, starter-template, webpack-config
- Language: JavaScript
- Size: 1.68 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Description
Starter project template for React app with TypeScript.
### Separate Config Files
Refer to https://webpack.js.org/guides/production/#setup.
There are three `webpack.*.js` files in the project setup.
* `webpack.config.js` - shared config
* `webpack.dev.js` - development config
* `webpack.prod.js` - production config
Instead of running the webpack with the `--mode` for different build config, using multiple webpack config files gives the most flexibility. `webpack-merge` plugin is used to combine the configurations at build time.
### webpack-dev-server
`webpack-dev-server` hosts the React component root during development.
`index.html` template file is registered with `HtmlWebpackPlugin` plugin, which hands off its output to the `webpack-dev-server` at runtime.
-----
## Install
Execute this to get everything ready.
```
npm install
```
## Run
This command runs the `webpack-dev-server` to dynamically host the `webpack`'s output.
```
npm run start:dev
```
## Build
```
# This will compile the project in development mode WITHOUT optimizations.
npm run build
```
```
# This will compile the project in development mode WITH optimizations.
npm run build:prod
```
#### Reference
* https://webpack.js.org/concepts/mode/#mode-production
* https://webpack.js.org/guides/production/#minification
## Clean
```
npm run clean
```