Skip to content

Commit 7e56319

Browse files
committed
feat(dev-server): Add webpack-dev-server.
1 parent 28df038 commit 7e56319

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ git clone https://github.com/emyann/typescript-webpack-starter.git
1414
cd typescript-webpack-starter
1515
```
1616

17-
## Build
17+
## Run
18+
Run a Webpack dev server
19+
```bash
20+
npm install
21+
npm run server
22+
```
23+
24+
## Build Only
1825
Build a development release
1926
```bash
2027
npm install
@@ -26,14 +33,14 @@ Build a production release
2633
npm install
2734
npm run build:prod
2835
```
29-
After build phase, those files are generated into the `dist` folder:
36+
After build phase, 3 files are generated into the `dist` folder:
3037
- `app.bundle.js` - contains the core of the application. From the entry point `src/index.ts`
3138
- `vendor.bundle.js` - contains the vendor dependencies
39+
- `index.html` - html page with references to the 2 files above
3240

3341
## TODO
3442

35-
- [-] Add samples (Jquery integration for example..)
36-
- [-] Setup a webpack-dev-server
37-
- [-] Setup VSCode debug to match webpack-dev-server
38-
- [-] Setup a webpack common configuration and use webpack-merge
39-
- [-] Setup for tests
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

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
"scripts": {
77
"rimraf": "rimraf",
88
"webpack": "webpack",
9+
"webpack-dev-server": "webpack-dev-server",
910
"build": "npm run build:dev",
1011
"prebuild:dev": "npm run rimraf -- dist",
1112
"build:dev": "webpack --config config/webpack/webpack.dev.js --progress --profile --color --display-error-details --display-cached",
1213
"prebuild:prod": "npm run rimraf -- dist",
1314
"build:prod": "webpack --config config/webpack/webpack.prod.js --progress --profile --color --display-error-details --display-cached --bail",
15+
"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/",
1417
"test": "echo \"Error: no test specified\" && exit 1",
1518
"postinstall": "typings i"
1619
},

0 commit comments

Comments
 (0)