Skip to content

🎥 Make videos programmatically with React

document rootDir

Jonny Burger10d388daf279
diff --git a/packages/bundler/src/bundle.ts b/packages/bundler/src/bundle.ts
index 5a926a6318..4b502026be 100644
--- a/packages/bundler/src/bundle.ts
+++ b/packages/bundler/src/bundle.ts
@@ -42,7 +42,7 @@ export type BundleOptions = {
outDir?: string;
enableCaching?: boolean;
publicPath?: string;
- remotionRoot?: string;
+ rootDir?: string;
};
export const getConfig = ({
@@ -79,7 +79,7 @@ export const bundle = async (
onProgressUpdate?: (progress: number) => void,
options?: BundleOptions
): Promise<string> => {
- const resolvedRemotionRoot = options?.remotionRoot ?? process.cwd();
+ const resolvedRemotionRoot = options?.rootDir ?? process.cwd();
const outDir = await prepareOutDir(options?.outDir ?? null);
diff --git a/packages/cli/src/setup-cache.ts b/packages/cli/src/setup-cache.ts
index 7f0affc066..fe175c393b 100644
--- a/packages/cli/src/setup-cache.ts
+++ b/packages/cli/src/setup-cache.ts
@@ -33,7 +33,7 @@ export const bundleOnCli = async ({
const options: BundleOptions = {
enableCaching: shouldCache,
webpackOverride: ConfigInternals.getWebpackOverrideFn() ?? ((f) => f),
- remotionRoot,
+ rootDir: remotionRoot,
};
const [hash] = BundlerInternals.getConfig({
diff --git a/packages/docs/docs/bundle.md b/packages/docs/docs/bundle.md
index b03d2979a3..780cd8bc89 100644
--- a/packages/docs/docs/bundle.md
+++ b/packages/docs/docs/bundle.md
@@ -75,6 +75,16 @@ _optional_
The path of the URL where the bundle is going to be hosted. By default it is `/`, meaning that the bundle is going to be hosted at the root of the domain (e.g. `https://localhost:3000/`). In some cases like rendering on Lambda, the public path might be a subdirectory.
+#### `rootDir?`
+
+_optional, available from v3.1.6_
+
+The directory in which the Remotion project is rooted in. This should be set to the directory that contains the `package.json` which installs Remotion. By default, it is the current working directory.
+
+:::note
+The current working directory is the directory from which your program gets executed from. It is not the same as the file where bundle() gets called.
+:::
+
## Return value
A promise which will resolve into a `string` specifying the output directory.