bundleCode
bundleCode(
options):Promise<BundleResult>
Bundle code using esbuild (client-side)
Transforms and bundles TypeScript/JavaScript code into a single file that can be executed by the Fluxbase Deno runtime.
Requires esbuild as a peer dependency.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | BundleOptions | Bundle options including source code |
Returns
Section titled “Returns”Promise<BundleResult>
Promise resolving to bundled code
Throws
Section titled “Throws”Error if esbuild is not available
Example
Section titled “Example”import { bundleCode } from '@fluxbase/sdk'
const bundled = await bundleCode({ code: ` import { helper } from './utils' export default async function handler(req) { return helper(req.payload) } `, minify: true,})
// Use bundled code in syncawait client.admin.functions.sync({ namespace: 'default', functions: [{ name: 'my-function', code: bundled.code, is_pre_bundled: true, }]})