How to use the @haul-bundler/core.Server function in @haul-bundler/core

To help you get started, we’ve selected a few @haul-bundler/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github callstack / haul / packages / haul-cli / src / commands / start.ts View on Github external
} catch (e) {
              runtime.logger.error(
                `Could not kill process! Reason: \n ${e.message}`
              );
              runtime.complete(1);
            }
            runtime.logger.info(`Successfully killed processes.`);
          } else {
            runtime.logger.error(
              `Could not spawn process! Reason: Port ${projectConfig.server.port} already in use.`
            );
            runtime.complete(1);
          }
        }

        new Server(runtime, configPath, {
          dev: argv.dev,
          noInteractive: !argv.interactive,
          minify: argv.minify === undefined ? !argv.dev : argv.minify,
          assetsDest: tempDir,
          root: directory,
          eager: parsedEager,
          platforms: projectConfig.platforms,
          bundleNames: Object.keys(projectConfig.bundles),
        }).listen(projectConfig.server.host, projectConfig.server.port);
      } catch (error) {
        runtime.logger.error('Command failed with error:', error);
        runtime.complete(1);
      }
    },
  };