How to use the @haul-bundler/core.getBundleFilename 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
'gray',
                bundleConfig.external.bundlePath
              )
            );
            if (bundleConfig.dll) {
              runtime.logger.info(
                'Manifest path',
                runtime.logger.enhanceWithColor(
                  'gray',
                  bundleConfig.external.manifestPath
                )
              );
            }

            if (bundleConfig.external.copyBundle) {
              const filename = getBundleFilename(
                env,
                projectConfig.templates,
                projectConfig.bundles[bundleName]
              );
              // `bundleOutput` should be a directory, but for backward-compatibility,
              // we also handle the case with a filename.
              let bundleOutputDirectory = bundleConfig.root;
              if (env.bundleOutput) {
                bundleOutputDirectory =
                  path.extname(env.bundleOutput) === ''
                    ? env.bundleOutput
                    : path.dirname(env.bundleOutput);
                bundleOutputDirectory = path.isAbsolute(bundleOutputDirectory)
                  ? bundleOutputDirectory
                  : path.join(bundleConfig.root, bundleOutputDirectory);
              }
github callstack / haul / packages / haul-core-legacy / src / compiler / worker / runWebpackCompiler.js View on Github external
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 {
        fs.copyFileSync(
          bundleConfig.external.bundlePath,
          path.join(outputPath, bundleFilename)
        );
        runtime.logger.done(
          `Copied external${
            bundleConfig.dll ? ' DLL' : ''