🎥 Make videos programmatically with React
fix port resolution
Jonny Burger7867500a1d67
diff --git a/packages/cli/src/preview.ts b/packages/cli/src/preview.tsindex c6a734178d..a0ddfa8dfa 100644--- a/packages/cli/src/preview.ts+++ b/packages/cli/src/preview.ts@@ -62,6 +62,18 @@ const getShouldOpenBrowser = (): {return {shouldOpenBrowser: true, reasonForBrowserDecision: 'default'};};+const getPort = () => {+ if (parsedCli.port) {+ return parsedCli.port;+ }++ if (ConfigInternals.getServerPort()) {+ return ConfigInternals.getServerPort();+ }++ return null;+};+export const previewCommand = async (remotionRoot: string, args: string[]) => {const {file, reason} = findEntryPoint(args, remotionRoot);@@ -78,7 +90,7 @@ export const previewCommand = async (remotionRoot: string, args: string[]) => {process.exit(1);}- const {port: desiredPort} = parsedCli;+ const desiredPort = getPort();const fullPath = path.join(process.cwd(), file);let inputProps = getInputProps((newProps) => {diff --git a/packages/example/remotion.config.ts b/packages/example/remotion.config.tsindex 4b94295e33..eceb2d7000 100644--- a/packages/example/remotion.config.ts+++ b/packages/example/remotion.config.ts@@ -3,3 +3,4 @@ import {webpackOverride} from './src/webpack-override';Config.Output.setOverwriteOutput(true);Config.Bundling.overrideWebpackConfig(webpackOverride);+Config.Bundling.setPort(8080);