(options = {})
| 57 | } |
| 58 | |
| 59 | async serve(options = {}) { |
| 60 | this.options = Object.assign(Cli.getDefaultOptions(), options); |
| 61 | |
| 62 | this.server = EleventyDevServer.getServer("eleventy-dev-server-cli", this.options.input, { |
| 63 | // TODO allow server configuration extensions |
| 64 | showVersion: true, |
| 65 | logger: Logger, |
| 66 | domDiff: this.options.domDiff, |
| 67 | |
| 68 | // CLI watches all files in the folder by default |
| 69 | // this is different from Eleventy usage! |
| 70 | watch: [ this.options.input ], |
| 71 | }); |
| 72 | |
| 73 | this.server.serve(this.options.port); |
| 74 | |
| 75 | // TODO? send any errors here to the server too |
| 76 | // with server.sendError({ error }); |
| 77 | } |
| 78 | |
| 79 | close() { |
| 80 | if(this.server) { |
no test coverage detected