@@ -10,10 +10,14 @@ const gulp = g.help(defaultGulp, helpConfig);
1010
1111import paths from '../../paths' ;
1212import statsConfig from '../../webpack-stats' ;
13- import devEnv from '../../dev-env' ;
1413import webpackConfig from '../../webpack.dev.babel' ;
1514
1615gulp . task ( 'serve' , 'serve, build (in memory only), and watch the app' , cb => {
16+ const host = 'localhost' ;
17+ const port = '8080' ;
18+ const protocol = 'http' ;
19+ const serverUrl = `${ protocol } ://${ host } :${ port } ` ;
20+
1721 // http://webpack.github.io/docs/webpack-dev-server.html#api
1822 const devMiddlewareConfig = {
1923 contentBase : paths . docsBuild ,
@@ -34,16 +38,16 @@ gulp.task('serve', 'serve, build (in memory only), and watch the app', cb => {
3438 }
3539
3640 new WebpackDevServer ( compiler , devMiddlewareConfig )
37- . listen ( devEnv . port , devEnv . host , ( err ) => {
41+ . listen ( port , host , err => {
3842 if ( err ) {
3943 throw new g . util . PluginError ( 'webpack-dev-server' , err ) ;
4044 }
4145
4246 g . util . log (
4347 g . util . colors . green ( '[webpack-dev-server]' ) ,
44- devEnv . serverUrl
48+ serverUrl
4549 ) ;
4650
47- childProcess . exec ( 'open ' + devEnv . serverUrl , onComplete ) ;
51+ childProcess . exec ( 'open ' + serverUrl , onComplete ) ;
4852 } ) ;
4953} ) ;
0 commit comments