How to use the @haul-bundler/core.getWebpackConfig 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-core-legacy / src / commands / bundle.js View on Github external
async function bundle(opts: *) {
  const directory = process.cwd();
  // Need to add @babel/register to support ES2015+ in config file.
  require('../babelRegister');
  const configPath = getProjectConfigPath(directory, opts.config);
  const projectConfig = getProjectConfig(configPath);
  const config = getWebpackConfig(
    new Runtime(),
    {
      platform: opts.platform,
      root: directory,
      dev: opts.dev,
      minify: opts.minify,
      bundle: true,
    },
    projectConfig
  );

  if (opts.assetsDest) {
    config.output.path = path.isAbsolute(opts.assetsDest)
      ? opts.assetsDest
      : path.join(directory, opts.assetsDest);
  }