* Starts a webserver at the repository root to serve built files. * @param {boolean=} lazyBuild * @return {Promise }
(lazyBuild = false)
| 214 | * @return {Promise<void>} |
| 215 | */ |
| 216 | async function doServe(lazyBuild = false) { |
| 217 | createCtrlcHandler('serve'); |
| 218 | const watchFunc = async () => { |
| 219 | await restartServer(); |
| 220 | }; |
| 221 | watch(serverFiles).on('change', debounce(watchFunc, watchDebounceDelay)); |
| 222 | await startServer({}, {lazyBuild}, {}); |
| 223 | if (lazyBuild) { |
| 224 | await performPreBuildSteps(); |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | module.exports = { |
| 229 | serve, |
no test coverage detected