Skip to content

Instantly share code, notes, and snippets.

@daniloab
Created October 31, 2021 22:26
Show Gist options
  • Save daniloab/9d9710224367cd9d83c3ce20b815d432 to your computer and use it in GitHub Desktop.
Save daniloab/9d9710224367cd9d83c3ce20b815d432 to your computer and use it in GitHub Desktop.
/**
 * Metro configuration for React Native
 * https://github.com/facebook/react-native
 *
 * @format
 */
const path = require('path');

module.exports = {
  watchFolders: [path.resolve(__dirname, '../caa-core-react')],
  resolver: {
    extraNodeModules: new Proxy(
      {},
      {
        get: (target, name) => {
          // eslint-disable-next-line
          if (target.hasOwnProperty(name)) {
            return target[name];
          }
          return path.join(process.cwd(), `node_modules/${name}`);
        },
      }
    ),
  },
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: true,
      },
    }),
  },
};

babel plugin config

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
    [
      'module-resolver',
      {
        alias: {
          'caa-core-react': '../caa-core-react/src',
        },
      },
    ],
  ],
};
// caa-core-react
// import { CoreProvider } from 'caa-core-react';

"@react-native-async-storage/async-storage": "^1.15.9",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment