How to use the @haul-bundler/core.sortBundlesByDependencies 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 / multiBundle.ts View on Github external
configPath
        );
        const env: EnvOptions = {
          platform,
          root: directory,
          dev,
          bundleMode: 'multi-bundle',
          bundleTarget: 'file',
          bundleOutput,
          assetsDest,
          sourcemapOutput,
          minify: minify === undefined ? !dev : minify,
        };
        const projectConfig = normalizedProjectConfigBuilder(runtime, env);

        for (const bundleName of sortBundlesByDependencies(projectConfig, {
          skipHostCheck,
        })) {
          const bundleConfig = projectConfig.bundles[bundleName];
          if (bundleConfig.external) {
            runtime.logger.info(
              `Using external${bundleConfig.dll ? ' DLL' : ''} bundle`,
              runtime.logger.enhanceWithModifier('bold', bundleName)
            );
            runtime.logger.info(
              'Bundle path',
              runtime.logger.enhanceWithColor(
                'gray',
                bundleConfig.external.bundlePath
              )
            );
            if (bundleConfig.dll) {
github callstack / haul / packages / haul-core-legacy / src / compiler / worker / runWebpackCompiler.js View on Github external
level,
      });
    });
  });

  const outputPath = configOptions.assetsDest;
  const projectConfig = getNormalizedProjectConfigBuilder(runtime, configPath)(
    runtime,
    {
      ...configOptions,
      platform,
    }
  );

  const apps = [];
  const bundles = sortBundlesByDependencies(projectConfig);
  let totalProgress = 0;
  let bundlesBuilt = 0;

  for (const bundleName of bundles) {
    const bundleConfig = projectConfig.bundles[bundleName];
    if (bundleConfig.external) {
      const bundleFilename = getBundleFilename(
        {
          ...configOptions,
          platform,
        },
        projectConfig.templates,
        bundleConfig
      );

      try {