How to use the babel-plugin-module-resolver.default function in babel-plugin-module-resolver

To help you get started, we’ve selected a few babel-plugin-module-resolver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo / react-native-lab / transformer.js View on Github external
function buildModuleResolverPreset() {
  const expoReactNativePath = path.join(__dirname, 'react-native');
  const expoReactPath = path.join(expoReactNativePath, 'node_modules/react');
  return {
    plugins: [
      [
        require('babel-plugin-module-resolver').default,
        {
          alias: {
            react: expoReactPath,
            'react-native': expoReactNativePath,
          },
        },
      ],
    ],
  };
}
github react-navigation / react-navigation / examples / NavigationPlayground / __exponent / transformer.js View on Github external
const buildAliasPreset = (reactNativePath, reactPath) => ({
  plugins: [
    [
      require('babel-plugin-module-resolver').default,
      {
        alias: Object.assign(
          {},
          {
            'react-native': path.resolve(
              `${reactNativePath || './node_modules/react-native'}`
            ),
            react: path.resolve(`${reactPath || './node_modules/react'}`),
          },
          require('babel-preset-exponent').plugins[0][1].alias
        ),
        cwd: path.resolve(__dirname, '..'),
      },
    ],
  ],
});
github zendesk / volunteer_portal / babel.config.js View on Github external
[
        require('@babel/plugin-transform-runtime').default,
        {
          helpers: false,
          regenerator: true,
          corejs: false,
        },
      ],
      [
        require('@babel/plugin-transform-regenerator').default,
        {
          async: false,
        },
      ],
      [
        require('babel-plugin-module-resolver').default,
        {
          root: ['./app/javascript/'],
        },
      ],
    ].filter(Boolean),
  }
}

babel-plugin-module-resolver

Module resolver plugin for Babel

MIT
Latest version published 8 months ago

Package Health Score

83 / 100
Full package analysis