Skip to content

Commit 92a7ee4

Browse files
committed
more wip
1 parent fb59d4b commit 92a7ee4

File tree

1 file changed

+20
-19
lines changed
  • packages/scripts/src/commands

1 file changed

+20
-19
lines changed

packages/scripts/src/commands/dev.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)