-
Hi there, I'm the author of Moti, a framer-motion-like library based on Reanimated 2. We're having an issue here where Moti is not working on Expo web. The problemThe problem is, Moti uses Is there a way I can include WorkaroundCurrently, I've fixed it by using const createExpoWebpackConfigAsync = require("@expo/webpack-config");
module.exports = async function (env, argv) {
const config = await createExpoWebpackConfigAsync(env, argv);
config.module.rules.push({
test: /\.(js|ts|tsx)$/,
exclude: /node_modules\/(?!(moti|@motify)\/).*/,
use: "babel-loader",
});
return config;
}; I have a feeling this isn't the right solution, but I don't really know my way around Webpack/Babel. Any help here would be greatly appreciated, thanks! Added contextI'm using Bob to compile Moti, and it looks like the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I found the right answer, thanks to the const createExpoWebpackConfigAsync = require("@expo/webpack-config");
module.exports = async function (env, argv) {
const config = await createExpoWebpackConfigAsync(
{
...env,
babel: { dangerouslyAddModulePathsToTranspile: ["moti"] },
},
argv
);
return config;
}; Expo lets you pass a custom set of node modules to transpile with |
Beta Was this translation helpful? Give feedback.
I found the right answer, thanks to the
@expo/webpack-config
docs:Expo lets you pass a custom set of node modules to transpile with
dangerouslyAddModulePathsToTranspile
, so that did it!