Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
const reactPreset = [
require('@babel/preset-react'),
{
development: isDev,
},
]
const reactPlugin = isProd
? [
require('babel-plugin-transform-react-remove-prop-types'),
{
removeImport: true,
},
]
: isDev && tryRequirePkg('react-hot-loader/babel')
if (react) {
presets.push(reactPreset)
if (reactPlugin) {
plugins.push(reactPlugin)
}
}
if (vue) {
presets.push('@vue/babel-preset-jsx')
}
return {
presets,
plugins,
exports.allowModules = monorepoPkgs.reduce((acc, pkg) => {
const pkgJson = tryRequirePkg(resolve(pkg, 'package.json'))
if (!pkgJson) {
return acc
}
const { name, peerDependencies = {}, dependencies = {} } = pkgJson
return acc.concat(
name,
Object.keys(peerDependencies),
Object.keys(dependencies),
)
}, [])
}