MCPcopy
hub / github.com/webpack/webpack-dev-server / start

Function start

test/helpers/test-server.js:55–81  ·  view source on GitHub ↗
(config, devServerConfig, done)

Source from the content-addressed store, hash-verified

53 * @returns {Server} server
54 */
55export function start(config, devServerConfig, done) {
56 let readyCount = 0;
57
58 const ready = (error) => {
59 if (error && done) {
60 done(error);
61
62 return;
63 }
64
65 readyCount += 1;
66
67 if (readyCount === 2) {
68 done();
69 }
70 };
71
72 const result = startFullSetup(config, devServerConfig, ready);
73
74 // wait for compilation, since dev server can start before this
75 // https://github.com/webpack/webpack-dev-server/issues/847
76 result.compiler.hooks.done.tap("done", () => {
77 ready();
78 });
79
80 return result.server;
81}
82
83/**
84 * @param {() => void} done done callback

Callers

nothing calls this directly

Calls 2

startFullSetupFunction · 0.85
readyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…