Skip to content

How to use Firebase modular (v9) #7597

Closed Answered by astanb
RobertSasak asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry, I omitted that part because it is nx specific. You would use it like so:

const customResolver = (context, moduleName, platform) => {
  if (moduleName.startsWith('firebase/')) {
    const path = `${context.nodeModulesPaths[0]}/@react-native-${moduleName}/lib/index.js`;

    console.log(
      '***** metro.config.js custom resolving',
      moduleName,
      'to',
      path,
      '*****'
    );

    return {
      filePath: path,
      type: 'sourceFile',
    };
  }

  // Ensure you call the default resolver.
  return context.resolveRequest(context, moduleName, platform);
};

const customConfig = {
  transformer: {
    babelTransformerPath: require.resolve('react-native-svg-transfo…

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
8 replies
@harveyappleton
Comment options

@astanb
Comment options

@gregfenton
Comment options

@astanb
Comment options

Answer selected by RobertSasak
@gregfenton
Comment options

Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Workflow: Needs Review Pending feedback or review from a maintainer.
4 participants