@@ -20,24 +20,6 @@ var mathjax3chtml = args.mathjax3chtml;
20
20
21
21
if ( strict ) config . entry = './lib/index-strict.js' ;
22
22
23
- // Create server
24
- var server = http . createServer ( ecstatic ( {
25
- root : constants . pathToRoot ,
26
- cache : 0 ,
27
- gzip : true ,
28
- cors : true
29
- } ) ) ;
30
-
31
- // Start the server up!
32
- server . listen ( PORT ) ;
33
-
34
- // open up browser window
35
- open ( 'http://localhost:' + PORT + '/devtools/test_dashboard/index' + (
36
- strict ? '-strict' :
37
- mathjax3 ? '-mathjax3' :
38
- mathjax3chtml ? '-mathjax3chtml' : ''
39
- ) + '.html' ) ;
40
-
41
23
// mock list
42
24
getMockFiles ( )
43
25
. then ( readFiles )
@@ -79,6 +61,8 @@ compiler.run(function(devtoolsErr, devtoolsStats) {
79
61
80
62
compiler . close ( function ( closeErr ) {
81
63
if ( ! closeErr ) {
64
+ var firstBundle = true ;
65
+
82
66
compiler = webpack ( config ) ;
83
67
compiler . watch ( { } , function ( err , stats ) {
84
68
if ( err ) {
@@ -87,6 +71,28 @@ compiler.run(function(devtoolsErr, devtoolsStats) {
87
71
console . log ( 'stats.errors:' , stats . errors ) ;
88
72
} else {
89
73
console . log ( 'success:' , config . output . path + '/' + config . output . filename ) ;
74
+
75
+ if ( firstBundle ) {
76
+ // Create server
77
+ var server = http . createServer ( ecstatic ( {
78
+ root : constants . pathToRoot ,
79
+ cache : 0 ,
80
+ gzip : true ,
81
+ cors : true
82
+ } ) ) ;
83
+
84
+ // Start the server up!
85
+ server . listen ( PORT ) ;
86
+
87
+ // open up browser window
88
+ open ( 'http://localhost:' + PORT + '/devtools/test_dashboard/index' + (
89
+ strict ? '-strict' :
90
+ mathjax3 ? '-mathjax3' :
91
+ mathjax3chtml ? '-mathjax3chtml' : ''
92
+ ) + '.html' ) ;
93
+
94
+ firstBundle = false ;
95
+ }
90
96
}
91
97
} ) ;
92
98
}
0 commit comments