Skip to content

🎥 Make videos programmatically with React

config

Jonny Burger54112fd55445
diff --git a/packages/cli/src/config/index.ts b/packages/cli/src/config/index.ts
index 3af47d36d4..8186485022 100644
--- a/packages/cli/src/config/index.ts
+++ b/packages/cli/src/config/index.ts
@@ -105,6 +105,7 @@ export const Config: ConfigType = {
setMaxTimelineTracks,
setKeyboardShortcutsEnabled,
setNumberOfSharedAudioTags,
+ setWebpackPollingInMilliseconds,
},
Bundling: {
overrideWebpackConfig,
@@ -112,7 +113,6 @@ export const Config: ConfigType = {
setPort,
setPublicDir,
setEntryPoint,
- setWebpackPollingInMilliseconds,
},
Log: {
setLevel: setLogLevel,
diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts
index 18b998a04b..18fb598169 100644
--- a/packages/core/src/config.ts
+++ b/packages/core/src/config.ts
@@ -47,6 +47,13 @@ export type ConfigType = {
* @default 0
*/
readonly setNumberOfSharedAudioTags: (numberOfAudioTags: number) => void;
+ /**
+ * Enable Webpack polling instead of file system listeners for hot reloading in the preview.
+ * This is useful if you are using a remote directory or a virtual machine.
+ * @param interval
+ * @default null
+ */
+ readonly setWebpackPollingInMilliseconds: (interval: number | null) => void;
};
readonly Bundling: {
/**
@@ -77,11 +84,6 @@ export type ConfigType = {
* You can set an absolute path or a relative path that will be resolved from the closest package.json location.
*/
readonly setPublicDir: (publicDir: string | null) => void;
- /**
- * Enable Webpack polling instead of file system listeners for hot reloading in the preview.
- * This is useful if you are using a remote directory or a virtual machine.
- */
- readonly setWebpackPollingInMilliseconds: (interval: number | null) => void;
};
readonly Log: {
/**
diff --git a/packages/docs/docs/cli/preview.md b/packages/docs/docs/cli/preview.md
index 8bf2075293..4a6b85209d 100644
--- a/packages/docs/docs/cli/preview.md
+++ b/packages/docs/docs/cli/preview.md
@@ -53,4 +53,11 @@ _Available from v3.2.13_
_Available from v3.2.11_
-Disables all keyboard shortcuts in the Preview.
+[Disables all keyboard shortcuts in the Preview](/docs/config#setkeyboardshortcutsenabled).
+
+### `--webpack-poll`
+
+_Available from v3.3.11_
+
+[Enables Webpack polling](/docs/config#setwebpackpollinginmilliseconds) instead of the file system event listeners for hot reloading. This is useful if you are inside a virtual machine or have a remote file system.
+Pass a value in milliseconds, for example `--webpack-poll=1000`.
diff --git a/packages/docs/docs/config.md b/packages/docs/docs/config.md
index c0f12706cd..857e806f7d 100644
--- a/packages/docs/docs/config.md
+++ b/packages/docs/docs/config.md
@@ -156,6 +156,21 @@ Config.Preview.setKeyboardShortcutsEnabled(false);
The [command line flag](/docs/cli/preview#--disable-keyboard-shortcuts) `--disable-keyboard-shortcuts` will take precedence over this option.
+### setWebpackPollingInMilliseconds()
+
+_available from v3.3.11_
+
+Enables Webpack polling instead of the file system event listeners for hot reloading.
+This is useful if you are inside a virtual machine or have a remote file system.
+
+```ts twoslash
+import { Config } from "remotion";
+// ---cut---
+Config.Preview.setWebpackPollingInMilliseconds(1000);
+```
+
+The [command line flag](/docs/cli/preview#--webpack-poll) `--webpack-poll` will take precedence over this option.
+
### setNumberOfSharedAudioTags()
_available from v3.3.2_