Skip to content

🎥 Make videos programmatically with React

add reanimated to optional dependencies (v3) change

Jonny Burger8a2c4251867d
diff --git a/packages/bundler/src/optional-depdendencies.ts b/packages/bundler/src/optional-depdendencies.ts
deleted file mode 100644
index d92614977a..0000000000
--- a/packages/bundler/src/optional-depdendencies.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-// When Webpack cannot resolve these dependencies, it will not print an error message.
-
-import type {Compiler} from 'webpack';
-
-const OPTIONAL_DEPENDENCIES = [
- 'zod',
- '@remotion/zod-types',
- 'react-native-reanimated',
- 'react-native-reanimated/package.json',
-];
-
-export class AllowOptionalDependenciesPlugin {
- filter(error: Error) {
- for (const dependency of OPTIONAL_DEPENDENCIES) {
- if (error.message.includes(`Can't resolve '${dependency}'`)) {
- return false;
- }
- }
-
- return true;
- }
-
- apply(compiler: Compiler) {
- compiler.hooks.afterEmit.tap(
- 'AllowOptionalDependenciesPlugin',
- (compilation) => {
- compilation.errors = compilation.errors.filter(this.filter);
- compilation.warnings = compilation.warnings.filter(this.filter);
- }
- );
- }
-}
diff --git a/packages/bundler/src/optional-dependencies.ts b/packages/bundler/src/optional-dependencies.ts
index 37a0d9ce5a..d92614977a 100644
--- a/packages/bundler/src/optional-dependencies.ts
+++ b/packages/bundler/src/optional-dependencies.ts
@@ -2,7 +2,12 @@
import type {Compiler} from 'webpack';
-export const OPTIONAL_DEPENDENCIES = ['zod', '@remotion/zod-types'];
+const OPTIONAL_DEPENDENCIES = [
+ 'zod',
+ '@remotion/zod-types',
+ 'react-native-reanimated',
+ 'react-native-reanimated/package.json',
+];
export class AllowOptionalDependenciesPlugin {
filter(error: Error) {