File tree Expand file tree Collapse file tree 1 file changed +20
-19
lines changed
packages/scripts/src/commands Expand file tree Collapse file tree 1 file changed +20
-19
lines changed Original file line number Diff line number Diff line change @@ -61,23 +61,26 @@ export default async function dev(options: {
6161 webpack,
6262 } ) ;
6363
64- const devServer = new WebpackDevServer ( compiler , {
65- compress : true ,
66- clientLogLevel : "none" ,
67- hot : true ,
68- publicPath : "/" ,
69- quiet : true ,
70- overlay : true ,
71-
72- historyApiFallback : {
73- // Paths with dots should still use the history fallback.
74- // See https://github.com/facebook/create-react-app/issues/387.
75- disableDotRule : true ,
64+ const devServer = new WebpackDevServer (
65+ {
66+ compress : true ,
67+ client : {
68+ logging : "none" ,
69+ overlay : true ,
70+ } ,
71+ hot : true ,
72+ historyApiFallback : {
73+ // Paths with dots should still use the history fallback.
74+ // See https://github.com/facebook/create-react-app/issues/387.
75+ disableDotRule : true ,
76+ } ,
77+ port,
7678 } ,
77- } ) ;
79+ compiler
80+ ) ;
7881
79- return new Promise ( ( resolve , reject ) => {
80- devServer . listen ( port , ( err ) => {
82+ return new Promise < void > ( ( resolve , reject ) => {
83+ devServer . startCallback ( ( err ) => {
8184 if ( err ) {
8285 reject ( err ) ;
8386 }
@@ -89,13 +92,11 @@ export default async function dev(options: {
8992 console . log ( chalk . cyan ( "Starting the development server...\n" ) ) ;
9093
9194 process . on ( "SIGINT" , ( ) => {
92- devServer . close ( ) ;
93- resolve ( ) ;
95+ devServer . stop ( ) . then ( resolve , reject ) ;
9496 } ) ;
9597
9698 process . on ( "SIGTERM" , ( ) => {
97- devServer . close ( ) ;
98- resolve ( ) ;
99+ devServer . stop ( ) . then ( resolve , reject ) ;
99100 } ) ;
100101 } ) ;
101102 } ) ;
You can’t perform that action at this time.
0 commit comments