Skip to content

How do I make the babel plugin apply to node_modules? #1715

Answered by nandorojo
nandorojo asked this question in Q&A
Discussion options

You must be logged in to vote

I found the right answer, thanks to the @expo/webpack-config docs:

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 dangerouslyAddModulePathsToTranspile, so that did it!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@IlyaTaidi
Comment options

Answer selected by nandorojo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants