Skip to content

Commit 8d6e908

Browse files
committed
feat(dev-server): Add webpack-dashboard plugin to dev configuration
1 parent 7e56319 commit 8d6e908

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

.vscode/launch.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
{
22
"version": "0.2.0",
33
"configurations": [
4-
{
5-
"name": "Launch with sourcemaps",
6-
"type": "chrome",
7-
"request": "launch",
8-
"url": "http://localhost/mypage.html",
9-
"webRoot": "${workspaceRoot}/dist",
10-
"sourceMaps": true
11-
},
124
{
135
"name": "Attach with sourcemaps",
146
"type": "chrome",
@@ -17,6 +9,7 @@
179
"port": 9222,
1810
"diagnosticLogging": true,
1911
"webRoot": "${workspaceRoot}/dist"
12+
2013
}
2114
]
2215
}

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,24 @@
1212
```bash
1313
git clone https://github.com/emyann/typescript-webpack-starter.git
1414
cd typescript-webpack-starter
15+
# Install the dependencies
16+
npm install
1517
```
1618

1719
## Run
1820
Run a Webpack dev server
1921
```bash
20-
npm install
2122
npm run server
2223
```
2324

2425
## Build Only
2526
Build a development release
2627
```bash
27-
npm install
2828
npm run build
2929
```
3030

3131
Build a production release
3232
```bash
33-
npm install
3433
npm run build:prod
3534
```
3635
After build phase, 3 files are generated into the `dist` folder:
@@ -40,7 +39,7 @@ After build phase, 3 files are generated into the `dist` folder:
4039

4140
## TODO
4241

43-
- [_] Add TODO example
44-
- [_] Setup VSCode debug to match webpack-dev-server
45-
- [_] Setup a webpack common configuration and use webpack-merge
46-
- [_] Setup unit tests
42+
- [ ] Add TODO example
43+
- [ ] Setup VSCode debug to match webpack-dev-server
44+
- [ ] Setup a webpack common configuration and use webpack-merge
45+
- [ ] Setup unit tests

config/webpack/webpack.dev.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const webpack = require('webpack');
22
const path = require('path');
33
const HtmlWebpackPlugin = require('html-webpack-plugin');
4+
const DashboardPlugin = require('webpack-dashboard/plugin');
45

56
var config = {
67
devtool: 'cheap-eval-source-map',
@@ -46,6 +47,7 @@ var config = {
4647
output: {comments: false},
4748
sourceMap: false
4849
}),
50+
new DashboardPlugin()
4951
],
5052
tslint: {
5153
emitErrors: false,

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"prebuild:prod": "npm run rimraf -- dist",
1414
"build:prod": "webpack --config config/webpack/webpack.prod.js --progress --profile --color --display-error-details --display-cached --bail",
1515
"server": "npm run server:dev",
16-
"server:dev": "webpack-dev-server --config config/webpack/webpack.dev.js --port 3000 --host 0.0.0.0 --hot --progress --profile --watch --inline --content-base dist/",
16+
"server:dev": "webpack-dashboard -- webpack-dev-server --config config/webpack/webpack.dev.js --port 3000 --host 0.0.0.0 --hot --inline --progress --profile --watch --content-base dist/",
1717
"test": "echo \"Error: no test specified\" && exit 1",
1818
"postinstall": "typings i"
1919
},
@@ -37,6 +37,7 @@
3737
"typescript": "^2.0.0",
3838
"typings": "^1.3.2",
3939
"webpack": "^2.1.0-beta.20",
40+
"webpack-dashboard": "^0.1.8",
4041
"webpack-dev-server": "^1.15.0"
4142
},
4243
"dependencies": {

0 commit comments

Comments
 (0)