Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,
},
},
],
],
};
}
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, '..'),
},
],
],
});
[
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),
}
}