An open API service indexing awesome lists of open source software.

https://github.com/cyberdex/webpack-typescript-boilerplate

Webpack config for comfortable coding on typescript
https://github.com/cyberdex/webpack-typescript-boilerplate

Last synced: about 1 year ago
JSON representation

Webpack config for comfortable coding on typescript

Awesome Lists containing this project

README

          

# Webpack typescript boilerplate


NPM Statusnpm

## 1. Install:

```
npm i webpack-typescript-boilerplate -D
```

## 2. Copy config file from module:

```
cp node_modules/webpack-typescript-boilerplate/setup/webpack.config.js ./
```

## 3. Change config inside copied file according to these values:

- `entryPoints` - an array of typescript files to bundle separately
- `sourceFolder` - folder for `awesome-typescript-loader` to include
- `assetsFolder` - folder with all additional files (pictures, sounds, configs etc.) witch should be included to release build
- `HTMLTemplate` - main app index.html file template
- `templateParameters` - variables that you will use inside html file like this: `<%= title %>`
- `https` - run DevServer with https (by default it's off)
- `port` - port number for local server (by default it will be 8080)
- `analyze` - add `webpack-bundle-analyzer plugin`

## 4. Put following values to `scripts` block of your package.json

```
"dev": "cross-env NODE_ENV=development webpack-dev-server",
"build": "cross-env NODE_ENV=production webpack"
```

## 5. Use it:

#### Local server (https://localhost:8080)

```
npm run dev
```

#### Production build

```
npm run build
```