@@ -14,7 +14,7 @@ import {
14
14
} from '@angular-devkit/build-webpack' ;
15
15
import { json , tags } from '@angular-devkit/core' ;
16
16
import * as path from 'path' ;
17
- import { Observable , from , of } from 'rxjs' ;
17
+ import { Observable , from } from 'rxjs' ;
18
18
import { concatMap , switchMap } from 'rxjs/operators' ;
19
19
import * as ts from 'typescript' ;
20
20
import * as url from 'url' ;
@@ -307,7 +307,7 @@ export function serveWebpackBrowser(
307
307
webpackDevServerFactory : require ( 'webpack-dev-server' ) as typeof webpackDevServer ,
308
308
} ,
309
309
) . pipe (
310
- concatMap ( ( buildEvent , index ) => {
310
+ concatMap ( async ( buildEvent , index ) => {
311
311
// Resolve serve address.
312
312
const serverAddress = url . format ( {
313
313
protocol : options . ssl ? 'https' : 'http' ,
@@ -325,16 +325,16 @@ export function serveWebpackBrowser(
325
325
` + '\n' ) ;
326
326
327
327
if ( options . open ) {
328
- const open = require ( 'open' ) ;
329
- open ( serverAddress ) ;
328
+ const open = await import ( 'open' ) ;
329
+ await open ( serverAddress ) ;
330
330
}
331
331
}
332
332
333
333
if ( buildEvent . success ) {
334
334
logger . info ( `\n${ colors . greenBright ( colors . symbols . check ) } Compiled successfully.` ) ;
335
335
}
336
336
337
- return of ( { ...buildEvent , baseUrl : serverAddress } as DevServerBuilderOutput ) ;
337
+ return { ...buildEvent , baseUrl : serverAddress } as DevServerBuilderOutput ;
338
338
} ) ,
339
339
) ;
340
340
} ) ,
0 commit comments