* @param {Configuration} config configuration * @param {DevServerConfiguration} devServerConfig dev server configuration * @param {(err?: Error) => void=} done done callback * @returns {{ server: Server, compiler: Compiler | MultiCompiler }} server and compiler
(config, devServerConfig, done)
| 18 | * @returns {{ server: Server, compiler: Compiler | MultiCompiler }} server and compiler |
| 19 | */ |
| 20 | function startFullSetup(config, devServerConfig, done) { |
| 21 | // disable watching by default for tests |
| 22 | if (typeof devServerConfig.static === "undefined") { |
| 23 | devServerConfig.static = false; |
| 24 | } else if (devServerConfig.static === null) { |
| 25 | // this provides a way of using the default static value |
| 26 | delete devServerConfig.static; |
| 27 | } |
| 28 | |
| 29 | const compiler = webpack(config); |
| 30 | |
| 31 | server = new Server(devServerConfig, compiler); |
| 32 | |
| 33 | server.startCallback((error) => { |
| 34 | if (error && done) { |
| 35 | return done(error); |
| 36 | } |
| 37 | |
| 38 | if (done) { |
| 39 | done(); |
| 40 | } |
| 41 | }); |
| 42 | |
| 43 | return { |
| 44 | server, |
| 45 | compiler, |
| 46 | }; |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * @param {Configuration} config configuration |
no test coverage detected
searching dependent graphs…