Enable inline requires (#1756)

zio/stable
dan 2023-10-27 01:54:15 +01:00 committed by GitHub
parent a1a61ef2e5
commit 46f3265936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -1,7 +1,14 @@
module.exports = function (api) {
api.cache(true)
return {
presets: ['babel-preset-expo'],
presets: [
[
'babel-preset-expo',
{
lazyImports: true,
},
],
],
plugins: [
[
'module:react-native-dotenv',

View File

@ -1,7 +1,15 @@
// Learn more https://docs.expo.io/guides/customizing-metro
const {getDefaultConfig} = require('expo/metro-config')
const cfg = getDefaultConfig(__dirname)
cfg.resolver.sourceExts = process.env.RN_SRC_EXT
? process.env.RN_SRC_EXT.split(',').concat(cfg.resolver.sourceExts)
: cfg.resolver.sourceExts
cfg.transformer.getTransformOptions = async () => ({
transform: {
inlineRequires: true,
},
})
module.exports = cfg