Skip to content

🎥 Make videos programmatically with React

new options for deploying webpack

Jonny Burger86ea2c79f126
diff --git a/packages/docs/docs/deployproject.md b/packages/docs/docs/deployproject.md
index 0bb6b68cfa..321f3ac47b 100644
--- a/packages/docs/docs/deployproject.md
+++ b/packages/docs/docs/deployproject.md
@@ -73,6 +73,18 @@ Callback function that gets called when uploading of the assets has progressed.
- `totalSize` (_number_): Total size in bytes of all the files in the bundle.
- `sizeUploaded` (_number_): Amount of bytes uploaded so far.
+### `webpackOverride`
+
+_optional_
+
+Allows to pass a custom webpack override. See [`bundle()` -> webpackOverride](/docs/bundle#webpackoverride) for more information.
+
+### `enableCaching`
+
+_optional - default true_
+
+Whether webpack caching should be enabled. See [`bundle()` -> enableCaching](/docs/bundle#enablecaching) for more information.
+
## Return value
An object with the following values:
diff --git a/packages/docs/docs/lambda-changelog.md b/packages/docs/docs/lambda-changelog.md
index 0babac29a5..f4930089e2 100644
--- a/packages/docs/docs/lambda-changelog.md
+++ b/packages/docs/docs/lambda-changelog.md
@@ -14,6 +14,11 @@ Keep track of changes to the APIs of Remotion Lambda here.
1. Redeploy your function: `npx remotion lambda functions deploy`
1. Migrate according to the changelog below:
+## Unreleased
+
+- Added `enableCaching` and `webpackOverride` options to `deployProject()` function.
+- Webpack override and webpack caching is now respected when deploying from the CLI
+
## September 14th, 2021
Version hash: `2.4.0-alpha.91579e8b`
diff --git a/packages/lambda/src/api/deploy-project.ts b/packages/lambda/src/api/deploy-project.ts
index e142d1dffe..976a513c0d 100644
--- a/packages/lambda/src/api/deploy-project.ts
+++ b/packages/lambda/src/api/deploy-project.ts
@@ -1,6 +1,6 @@
import {PutBucketWebsiteCommand} from '@aws-sdk/client-s3';
import {bundle} from '@remotion/bundler';
-import {Internals} from 'remotion';
+import {Internals, WebpackOverrideFn} from 'remotion';
import {AwsRegion} from '../pricing/aws-regions';
import {getS3Client} from '../shared/aws-clients';
import {getSitesKey, REMOTION_BUCKET_PREFIX} from '../shared/constants';
@@ -16,6 +16,8 @@ type DeployProjectInput = {
onBundleProgress?: (progress: number) => void;
onWebsiteActivated?: () => void;
onUploadProgress?: (upload: UploadDirProgress) => void;
+ webpackOverride?: WebpackOverrideFn;
+ enableCaching?: boolean;
};
};
@@ -45,8 +47,9 @@ export const deployProject = async ({
options?.onBundleProgress ?? (() => undefined),
{
publicPath: `/${subFolder}/`,
- webpackOverride: Internals.getWebpackOverrideFn(),
- enableCaching: Internals.getWebpackCaching(),
+ webpackOverride:
+ options?.webpackOverride ?? Internals.getWebpackOverrideFn(),
+ enableCaching: options?.enableCaching ?? Internals.getWebpackCaching(),
}
);