Skip to content

🎥 Make videos programmatically with React

build

Jonny Burger2efdc8f36c64
diff --git a/packages/lambda/build.ts b/packages/lambda/build.ts
index aa79131744..8c36c1cfdb 100644
--- a/packages/lambda/build.ts
+++ b/packages/lambda/build.ts
@@ -1,3 +1,4 @@
+import {BundlerInternals} from '@remotion/bundler';
import {dir} from '@remotion/compositor-linux-arm64-gnu';
import fs, {cpSync, readdirSync} from 'node:fs';
import path from 'node:path';
@@ -17,17 +18,15 @@ const template = require.resolve(
path.join(__dirname, 'src', 'functions', 'index'),
);
-const resul = await Bun.build({
- entrypoints: [template],
- target: 'node',
- minify: false,
+await BundlerInternals.esbuild.build({
+ platform: 'node',
+ target: 'node16',
+ bundle: true,
+ outfile,
+ entryPoints: [template],
+ treeShaking: true,
+ external: [],
});
-if (!resul.success) {
- console.error(resul.logs);
- process.exit(1);
-}
-
-await Bun.write(outfile, resul.outputs[0]);
const filesInCwd = readdirSync(dir);
const filesToCopy = filesInCwd.filter(
diff --git a/packages/lambda/src/functions/aws-implementation.ts b/packages/lambda/src/functions/aws-implementation.ts
index c00c3d4ee1..1eaf165514 100644
--- a/packages/lambda/src/functions/aws-implementation.ts
+++ b/packages/lambda/src/functions/aws-implementation.ts
@@ -1,5 +1,5 @@
import {type ProviderSpecifics} from '@remotion/serverless';
-import {EventEmitter} from 'node:stream';
+import {EventEmitter} from 'node:events';
import {bucketExistsInRegionImplementation} from '../api/bucket-exists';
import {createBucket} from '../api/create-bucket';
import {getRemotionBuckets} from '../api/get-buckets';
diff --git a/packages/lambda/src/functions/launch.ts b/packages/lambda/src/functions/launch.ts
index f29360d7c8..e796d52aa1 100644
--- a/packages/lambda/src/functions/launch.ts
+++ b/packages/lambda/src/functions/launch.ts
@@ -23,9 +23,9 @@ import {
serializeOrThrow,
} from '@remotion/serverless/client';
import {existsSync, mkdirSync, rmSync} from 'fs';
+import {type EventEmitter} from 'node:events';
import {join} from 'path';
import {VERSION} from 'remotion/version';
-import {type EventEmitter} from 'stream';
import type {PostRenderData} from '../shared/constants';
import {
CONCAT_FOLDER_TOKEN,
diff --git a/packages/lambda/src/shared/call-lambda.ts b/packages/lambda/src/shared/call-lambda.ts
index 667702f28c..ad927a30d1 100644
--- a/packages/lambda/src/shared/call-lambda.ts
+++ b/packages/lambda/src/shared/call-lambda.ts
@@ -22,7 +22,7 @@ import {
messageTypeIdToMessageType,
} from '@remotion/serverless/client';
import {makeStreamer} from '@remotion/streaming';
-import type {EventEmitter} from 'stream';
+import type {EventEmitter} from 'node:events';
import type {OrError} from '../functions';
import type {AwsRegion} from '../regions';
import {getLambdaClient} from './aws-clients';