How to use the ern-container-gen.bundleMiniAppsFromComposite function in ern-container-gen

To help you get started, we’ve selected a few ern-container-gen 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 electrode-io / electrode-native / ern-local-cli / src / commands / bundlestore / upload.ts View on Github external
baseComposite,
        extraJsDependencies,
        jsApiImplDependencies: jsApiImpls,
        miniApps: miniapps!,
        outDir: compositeDir,
        pathToYarnLock,
        resolutions,
      })
    )

    for (const curPlatform of platforms) {
      const outDir = createTmpDir()
      const bundlePath = path.join(outDir, 'index.bundle')
      const sourceMapPath = path.join(outDir, 'index.map')
      await kax.task(`Bundling MiniApps for ${curPlatform}`).run(
        bundleMiniAppsFromComposite({
          bundleOutput: bundlePath,
          compositeDir,
          dev: !prod,
          outDir,
          platform: curPlatform,
          sourceMapOutput: path.join(outDir, 'index.map'),
        })
      )
      const bundleId = await kax
        .task(`Uploading ${curPlatform} bundle`)
        .run(
          engine.upload({ bundlePath, platform: curPlatform, sourceMapPath })
        )
      log.info(`Successfully uploaded ${curPlatform} bundle [id: ${bundleId}]`)
    }
  }