diff --git a/packages/blade/package.json b/packages/blade/package.json index 41226ceb557..d06afe05148 100644 --- a/packages/blade/package.json +++ b/packages/blade/package.json @@ -294,7 +294,6 @@ "react-dom": ">=18", "styled-components": "^5", "framer-motion": ">=4", - "motion": ">=11", "react-native": "^0.72", "@floating-ui/react-native": "^0.10.0", "react-native-reanimated": "^3.4.1", @@ -314,9 +313,6 @@ }, "react-native-reanimated": { "optional": true - }, - "motion": { - "optional": true } }, "resolutions": { diff --git a/packages/blade/rollup.config.mjs b/packages/blade/rollup.config.mjs index 90ae580f8f2..b56c24c99ea 100644 --- a/packages/blade/rollup.config.mjs +++ b/packages/blade/rollup.config.mjs @@ -51,7 +51,11 @@ const nativeExtensions = [ const packageJsonDeps = Object.keys(packagejson.dependencies).filter( (name) => name !== 'patch-package', ); -const externalDependencies = packageJsonDeps; + +// `framer-motion` was renamed to `motion`. To support the older versions of framer-motion, we have kept `framer-motion` as peer dependency right now. +// Although we also want to make sure that if someone installs `motion` instead, it should externalize correctly +// We cannot mark `motion` and `framer-motion` both as peer dependencies because `motion` might end up installing different `framer-motion` version internally which can end up clashing (TLDR: I tried and it didn't work) +const externalDependencies = [...packageJsonDeps, 'motion']; const inputRootDirectory = 'src'; const outputRootDirectory = 'build';