Skip to content

@salesforce/b2c-tooling-sdk / operations/mrt / createBundle

Function: createBundle()

createBundle(options): Promise<Bundle>

Defined in: packages/b2c-tooling-sdk/src/operations/mrt/bundle.ts:174

Creates a bundle from a build directory.

This creates a tar archive of the build directory, base64 encodes it, and returns a bundle object ready for upload to Managed Runtime.

The archive structure is: {projectSlug}/bld/{files...}

Parameters

options

CreateBundleOptions

Bundle creation options

Returns

Promise<Bundle>

Bundle object ready for upload

Throws

Error if build directory doesn't exist or ssr patterns are empty

Example

typescript
const bundle = await createBundle({
  projectSlug: 'my-project',
  ssrOnly: ['ssr.js'],
  ssrShared: ['**/*.js', 'static/**/*'],
  buildDirectory: './build',
  message: 'Release v1.0.0'
});

All rights reserved.