build-system/tasks/serve.js
/**
 * Starts a webserver at the repository root to serve built files.
 * @param {boolean=} lazyBuild
 */
Starts a webserver at the repository root to serve built files.
@param {boolean=} lazyBuild
Starts a webserver at the repository root to serve built files . @param { boolean = } lazyBuild
async function doServe(lazyBuild = false) {
  createCtrlcHandler('serve');
  const watchFunc = async () => {
    await restartServer();
  };
  watch(serverFiles).on('change', debounce(watchFunc, watchDebounceDelay));
  if (argv.new_server) {
    buildNewServer();
  }
  await startServer({}, {lazyBuild}, {});
  if (lazyBuild) {
    await performPreBuildSteps();
  }
}
async function doServe ( lazyBuild = false ) { createCtrlcHandler ( 'serve' ) ; const watchFunc = async ( ) => { await restartServer ( ) ; } ; watch ( serverFiles ) . on ( 'change' , debounce ( watchFunc , watchDebounceDelay ) ) ; if ( argv . new_server ) { buildNewServer ( ) ; } await startServer ( { } , { lazyBuild } , { } ) ; if ( lazyBuild ) { await performPreBuildSteps ( ) ; } }
Starts a webserver at the repository root to serve built files.
Starts a webserver at the repository root to serve built files .