File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,18 @@ program
30
30
. action ( function ( cmd , options ) {
31
31
console . log ( "netlify-lambda: Starting server" ) ;
32
32
var static = Boolean ( program . static ) ;
33
- if ( static ) return ; // early terminate, don't build
34
33
var server ;
34
+ var startServer = function ( ) {
35
+ server = serve . listen (
36
+ program . port || 9000 ,
37
+ static ,
38
+ Number ( program . timeout ) || 10
39
+ ) ;
40
+ }
41
+ if ( static ) {
42
+ startServer ( ) ;
43
+ return ; // early terminate, don't build
44
+ } ;
35
45
build . watch ( cmd , program . config , function ( err , stats ) {
36
46
if ( err ) {
37
47
console . error ( err ) ;
@@ -40,11 +50,7 @@ program
40
50
41
51
console . log ( stats . toString ( { color : true } ) ) ;
42
52
if ( ! server ) {
43
- server = serve . listen (
44
- program . port || 9000 ,
45
- static ,
46
- Number ( program . timeout ) || 10
47
- ) ;
53
+ startServer ( ) ;
48
54
}
49
55
stats . compilation . chunks . forEach ( function ( chunk ) {
50
56
server . clearCache ( chunk . name ) ;
You can’t perform that action at this time.
0 commit comments