@@ -6,7 +6,8 @@ var argv = require('yargs').argv;
6
6
var gulp = require ( 'gulp' ) ;
7
7
var PluginError = require ( 'plugin-error' ) ;
8
8
var fancyLog = require ( 'fancy-log' ) ;
9
- var connect = require ( 'gulp-connect' ) ;
9
+ var express = require ( 'express' ) ;
10
+ var http = require ( 'http' ) ;
10
11
var webpack = require ( 'webpack' ) ;
11
12
var webpackStream = require ( 'webpack-stream' ) ;
12
13
var gulpClean = require ( 'gulp-clean' ) ;
@@ -101,12 +102,9 @@ function viewCoverage(done) {
101
102
var coveragePort = 1999 ;
102
103
var mylocalhost = ( argv . host ) ? argv . host : 'localhost' ;
103
104
104
- connect . server ( {
105
- port : coveragePort ,
106
- root : 'build/coverage/lcov-report' ,
107
- livereload : false ,
108
- debug : true
109
- } ) ;
105
+ const app = express ( ) ;
106
+ app . use ( express . static ( 'build/coverage/lcov-report' ) ) ;
107
+ http . createServer ( app ) . listen ( coveragePort ) ;
110
108
opens ( 'http://' + mylocalhost + ':' + coveragePort ) ;
111
109
done ( ) ;
112
110
} ;
@@ -173,8 +171,7 @@ function makeDevpackPkg(config = webpackConfig) {
173
171
. forEach ( ( use ) => use . options = Object . assign ( { } , use . options , babelConfig ) ) ;
174
172
175
173
return prebidSource ( cloned )
176
- . pipe ( gulp . dest ( 'build/dev' ) )
177
- . pipe ( connect . reload ( ) ) ;
174
+ . pipe ( gulp . dest ( 'build/dev' ) ) ;
178
175
}
179
176
}
180
177
@@ -480,28 +477,17 @@ function startIntegServer(dev = false) {
480
477
}
481
478
482
479
function startLocalServer ( options = { } ) {
483
- connect . server ( {
484
- https : argv . https ,
485
- port : port ,
486
- host : INTEG_SERVER_HOST ,
487
- root : './' ,
488
- livereload : options . livereload ,
489
- middleware : function ( ) {
490
- return [
491
- function ( req , res , next ) {
492
- res . setHeader ( 'Ad-Auction-Allowed' , 'True' ) ;
493
- next ( ) ;
494
- }
495
- ] ;
496
- }
480
+ const app = express ( ) ;
481
+ app . use ( function ( req , res , next ) {
482
+ res . setHeader ( 'Ad-Auction-Allowed' , 'True' ) ;
483
+ next ( ) ;
497
484
} ) ;
485
+ app . use ( express . static ( './' ) ) ;
486
+ http . createServer ( app ) . listen ( port , INTEG_SERVER_HOST ) ;
498
487
}
499
488
500
489
// Watch Task with Live Reload
501
490
function watchTaskMaker ( options = { } ) {
502
- if ( options . livereload == null ) {
503
- options . livereload = true ;
504
- }
505
491
options . alsoWatch = options . alsoWatch || [ ] ;
506
492
507
493
return function watch ( done ) {
@@ -513,15 +499,15 @@ function watchTaskMaker(options = {}) {
513
499
'modules/**/*.js' ,
514
500
] . concat ( options . alsoWatch ) ) ;
515
501
516
- startLocalServer ( options ) ;
502
+ startLocalServer ( ) ;
517
503
518
504
mainWatcher . on ( 'all' , options . task ( ) ) ;
519
505
done ( ) ;
520
506
}
521
507
}
522
508
523
509
const watch = watchTaskMaker ( { alsoWatch : [ 'test/**/*.js' ] , task : ( ) => gulp . series ( clean , gulp . parallel ( lint , 'build-bundle-dev' , test ) ) } ) ;
524
- const watchFast = watchTaskMaker ( { livereload : false , task : ( ) => gulp . series ( 'build-bundle-dev' ) } ) ;
510
+ const watchFast = watchTaskMaker ( { task : ( ) => gulp . series ( 'build-bundle-dev' ) } ) ;
525
511
526
512
// support tasks
527
513
gulp . task ( lint ) ;
0 commit comments