Skip to content

🎥 Make videos programmatically with React

bundling

Jonny Burgerc04bb63892fb
diff --git a/packages/animation-utils/package.json b/packages/animation-utils/package.json
index 7cbd65a180..877a4194b5 100644
--- a/packages/animation-utils/package.json
+++ b/packages/animation-utils/package.json
@@ -14,11 +14,16 @@
"formatting": "prettier src --check",
"lint": "eslint src --ext ts,tsx",
"watch": "tsc -w",
- "build": "tsc -d"
+ "build": "tsc -d && rollup --config rollup.config.js"
},
"dependencies": {
"remotion": "workspace:*"
},
+ "files": [
+ "dist",
+ "!dist/tsconfig-esm.tsbuildinfo",
+ "!dist/test"
+ ],
"peerDependencies": {
"react": ">=16.8.0",
"react-dom": ">=16.8.0"
@@ -29,7 +34,18 @@
"prettier": "3.1.1",
"prettier-plugin-organize-imports": "3.2.4",
"eslint": "8.42.0",
- "@jonny/eslint-config": "3.0.276"
+ "@jonny/eslint-config": "3.0.276",
+ "vitest": "0.31.1",
+ "rollup": "^2.70.1"
+ },
+ "exports": {
+ "./package.json": "./package.json",
+ ".": {
+ "types": "./dist/index.d.ts",
+ "module": "./dist/esm/index.mjs",
+ "import": "./dist/esm/index.mjs",
+ "require": "./dist/index.js"
+ }
},
"publishConfig": {
"access": "public"
diff --git a/packages/animation-utils/rollup.config.js b/packages/animation-utils/rollup.config.js
new file mode 100644
index 0000000000..145571d05a
--- /dev/null
+++ b/packages/animation-utils/rollup.config.js
@@ -0,0 +1,23 @@
+// rollup.config.js
+import typescript from '@rollup/plugin-typescript';
+
+export default [
+ {
+ input: 'src/index.ts',
+ output: [
+ {
+ file: 'dist/esm/index.mjs',
+ format: 'es',
+ sourcemap: false,
+ },
+ ],
+ external: ['react', 'remotion', 'react/jsx-runtime'],
+ plugins: [
+ typescript({
+ tsconfig: 'tsconfig-esm.json',
+ sourceMap: false,
+ outputToFilesystem: true,
+ }),
+ ],
+ },
+];
diff --git a/packages/animation-utils/tsconfig-esm.json b/packages/animation-utils/tsconfig-esm.json
new file mode 100644
index 0000000000..38c57cd749
--- /dev/null
+++ b/packages/animation-utils/tsconfig-esm.json
@@ -0,0 +1,11 @@
+{
+ "extends": "../tsconfig-esm.settings.json",
+ "compilerOptions": {
+ "rootDir": "./src",
+ "outDir": "./dist/esm",
+ "skipLibCheck": true,
+ "jsx": "react-jsx",
+ "moduleResolution": "node"
+ },
+ "include": ["./src"]
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 39cb36510c..9b6bb2ed1b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -52,6 +52,12 @@ importers:
prettier-plugin-organize-imports:
specifier: 3.2.4
+ rollup:
+ specifier: ^2.70.1
+ version: 2.76.0
+ vitest:
+ specifier: 0.31.1
+ version: 0.31.1([email protected])
packages/astro-example:
dependencies:
@@ -15864,6 +15870,7 @@ packages:
resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==}
+ deprecated: Please upgrade to 2.3.7 which fixes GHSA-4q6p-r6v2-jvc5
dependencies:
get-func-name: 2.0.0