File tree Expand file tree Collapse file tree 4 files changed +25
-19
lines changed Expand file tree Collapse file tree 4 files changed +25
-19
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"version" : " 0.2.0" ,
3
3
"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
- },
12
4
{
13
5
"name" : " Attach with sourcemaps" ,
14
6
"type" : " chrome" ,
17
9
"port" : 9222 ,
18
10
"diagnosticLogging" : true ,
19
11
"webRoot" : " ${workspaceRoot}/dist"
12
+
20
13
}
21
14
]
22
15
}
Original file line number Diff line number Diff line change 12
12
``` bash
13
13
git clone https://github.com/emyann/typescript-webpack-starter.git
14
14
cd typescript-webpack-starter
15
+ # Install the dependencies
16
+ npm install
17
+ ```
18
+
19
+ ## Run
20
+ Run a Webpack dev server
21
+ ``` bash
22
+ npm run server
15
23
```
16
24
17
- ## Build
25
+ ## Build Only
18
26
Build a development release
19
27
``` bash
20
- npm install
21
28
npm run build
22
29
```
23
30
24
31
Build a production release
25
32
``` bash
26
- npm install
27
33
npm run build:prod
28
34
```
29
- After build phase, those files are generated into the ` dist ` folder:
35
+ After build phase, 3 files are generated into the ` dist ` folder:
30
36
- ` app.bundle.js ` - contains the core of the application. From the entry point ` src/index.ts `
31
37
- ` vendor.bundle.js ` - contains the vendor dependencies
38
+ - ` index.html ` - html page with references to the 2 files above
32
39
33
40
## TODO
34
41
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
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
Original file line number Diff line number Diff line change 1
1
const webpack = require ( 'webpack' ) ;
2
2
const path = require ( 'path' ) ;
3
3
const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
4
+ const DashboardPlugin = require ( 'webpack-dashboard/plugin' ) ;
4
5
5
6
var config = {
6
7
devtool : 'cheap-eval-source-map' ,
@@ -46,6 +47,7 @@ var config = {
46
47
output : { comments : false } ,
47
48
sourceMap : false
48
49
} ) ,
50
+ new DashboardPlugin ( )
49
51
] ,
50
52
tslint : {
51
53
emitErrors : false ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " typescript-webpack-starter" ,
3
- "version" : " 0.0.1 " ,
3
+ "version" : " 0.1.0 " ,
4
4
"description" : " A damn simple starter for Typescript and Webpack" ,
5
5
"main" : " src/index.ts" ,
6
6
"scripts" : {
7
7
"rimraf" : " rimraf" ,
8
8
"webpack" : " webpack" ,
9
+ "webpack-dev-server" : " webpack-dev-server" ,
9
10
"build" : " npm run build:dev" ,
10
11
"prebuild:dev" : " npm run rimraf -- dist" ,
11
12
"build:dev" : " webpack --config config/webpack/webpack.dev.js --progress --profile --color --display-error-details --display-cached" ,
12
13
"prebuild:prod" : " npm run rimraf -- dist" ,
13
14
"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-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/" ,
14
17
"test" : " echo \" Error: no test specified\" && exit 1" ,
15
18
"postinstall" : " typings i"
16
19
},
33
36
"tslint-loader" : " ^2.1.5" ,
34
37
"typescript" : " ^2.0.0" ,
35
38
"typings" : " ^1.3.2" ,
36
- "webpack" : " ^2.1.0-beta.20"
39
+ "webpack" : " ^2.1.0-beta.20" ,
40
+ "webpack-dashboard" : " ^0.1.8" ,
41
+ "webpack-dev-server" : " ^1.15.0"
37
42
},
38
43
"dependencies" : {
39
44
"lodash" : " ^4.14.1"
You can’t perform that action at this time.
0 commit comments