Skip to content

🎥 Make videos programmatically with React

removed way to start with ts-node, now always use JS file

Jonny Burgerf25d0ce6676b
diff --git a/packages/cli/package.json b/packages/cli/package.json
index 5d8f2bac18..26d5f43697 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -10,8 +10,7 @@
"scripts": {
"test": "eslint src --ext ts,tsx",
"build": "tsc -d",
- "watch": "tsc -w",
- "dev": "ts-node src/preview.ts x ../example/src/index.tsx"
+ "watch": "tsc -w"
},
"files": [
"dist",
diff --git a/packages/cli/src/preview.ts b/packages/cli/src/preview.ts
index 6e7297f571..48dea724c9 100644
--- a/packages/cli/src/preview.ts
+++ b/packages/cli/src/preview.ts
@@ -2,7 +2,6 @@ import {startServer} from '@remotion/bundler';
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore
import betterOpn from 'better-opn';
-import fs from 'fs';
import path from 'path';
import xns from 'xns';
import {getConfigFileName} from './get-config-file-name';
@@ -13,13 +12,12 @@ export const previewCommand = xns(async () => {
const file = args[3];
const fullPath = path.join(process.cwd(), file);
- const tsxFile = path.resolve(__dirname, 'previewEntry.tsx');
- const jsFile = path.resolve(__dirname, 'previewEntry.js');
loadConfigFile(getConfigFileName());
- const fileChosen = fs.existsSync(tsxFile) ? tsxFile : jsFile;
-
- const port = await startServer(fileChosen, fullPath);
+ const port = await startServer(
+ path.resolve(__dirname, 'previewEntry.js'),
+ fullPath
+ );
betterOpn(`http://localhost:${port}`);
await new Promise(() => void 0);
});