Skip to content

🎥 Make videos programmatically with React

esm for motion blur

Jonny Burger0c060a3e4b29
diff --git a/packages/motion-blur/package.json b/packages/motion-blur/package.json
index 5e3ee8f669..9749857a4c 100644
--- a/packages/motion-blur/package.json
+++ b/packages/motion-blur/package.json
@@ -8,7 +8,7 @@
"scripts": {
"lint": "eslint src --ext ts,tsx",
"watch": "tsc -w",
- "build": "tsc -d"
+ "build": "rollup --config rollup.config.js && tsc -d"
},
"author": "Matt McGillivray, Ilija Boshkov <[email protected]>, Jonny Burger <[email protected]>",
"contributors": [],
@@ -26,14 +26,25 @@
"react": ">=16.8.0",
"react-dom": ">=16.8.0"
},
+ "exports": {
+ "./package.json": "./package.json",
+ ".": {
+ "types": "./dist/cjs/index.d.ts",
+ "module": "./dist/esm/index.mjs",
+ "import": "./dist/esm/index.mjs",
+ "require": "./dist/cjs/index.js"
+ }
+ },
"devDependencies": {
"@jonny/eslint-config": "3.0.266",
"@types/react": "18.0.26",
+ "@rollup/plugin-typescript": "^8.2.0",
"eslint": "8.25.0",
"prettier": "^2.7.1",
"prettier-plugin-organize-imports": "^2.3.4",
"react": "18.0.0",
"react-dom": "18.0.0",
+ "rollup": "^2.70.1",
"remotion": "3.3.58",
"typescript": "^4.7.0"
},
diff --git a/packages/motion-blur/rollup.config.js b/packages/motion-blur/rollup.config.js
new file mode 100644
index 0000000000..60c3873b68
--- /dev/null
+++ b/packages/motion-blur/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', 'lottie-web'],
+ plugins: [
+ typescript({
+ tsconfig: 'tsconfig-esm.json',
+ sourceMap: false,
+ outputToFilesystem: true,
+ }),
+ ],
+ },
+];
diff --git a/packages/motion-blur/tsconfig-esm.json b/packages/motion-blur/tsconfig-esm.json
new file mode 100644
index 0000000000..93ac160761
--- /dev/null
+++ b/packages/motion-blur/tsconfig-esm.json
@@ -0,0 +1,13 @@
+{
+ "extends": "../tsconfig-esm.settings.json",
+ "compilerOptions": {
+ "composite": true,
+ "rootDir": "./src",
+ "outDir": "./dist/esm",
+ "skipLibCheck": true,
+ "jsx": "react-jsx",
+ "moduleResolution": "node"
+ },
+ "references": [{"path": "../core"}],
+ "include": ["./src"]
+}
diff --git a/packages/motion-blur/tsconfig.json b/packages/motion-blur/tsconfig.json
index 402f70f469..8e4a6149e0 100644
--- a/packages/motion-blur/tsconfig.json
+++ b/packages/motion-blur/tsconfig.json
@@ -3,7 +3,7 @@
"compilerOptions": {
"composite": true,
"rootDir": "src",
- "outDir": "dist",
+ "outDir": "dist/cjs",
"skipLibCheck": true
},
"include": ["src"],
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4c2cfa909a..b536582bac 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -778,6 +778,7 @@ importers:
packages/motion-blur:
specifiers:
'@jonny/eslint-config': 3.0.266
+ '@rollup/plugin-typescript': ^8.2.0
'@types/react': 18.0.26
eslint: 8.25.0
prettier: ^2.7.1
@@ -785,17 +786,20 @@ importers:
react: 18.0.0
react-dom: 18.0.0
remotion: 3.3.62
+ rollup: ^2.70.1
typescript: ^4.7.0
dependencies:
remotion: link:../core
devDependencies:
'@jonny/eslint-config': 3.0.266_t54va6jeo5lf3vtqih5uiyrm5e
+ '@rollup/plugin-typescript': 8.5.0_2s5nfqwcf62746iqzotp3mpuy4
'@types/react': 18.0.26
eslint: 8.25.0
prettier: 2.7.1
prettier-plugin-organize-imports: 2.3.4_j2odc4yr77iddtreafyicbq5hi
react: 18.0.0
react-dom: [email protected]
+ rollup: 2.76.0
typescript: 4.7.2
packages/noise:
@@ -24852,8 +24856,8 @@ packages:
'@webassemblyjs/ast': 1.11.1
'@webassemblyjs/wasm-edit': 1.11.1
'@webassemblyjs/wasm-parser': 1.11.1
- acorn: 8.8.0
- acorn-import-assertions: [email protected]
+ acorn: 8.8.1
+ acorn-import-assertions: [email protected]
browserslist: 4.21.4
chrome-trace-event: 1.0.3
enhanced-resolve: 5.10.0