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) { module.exports = function (api) {
api.cache(true) api.cache(true)
return { return {
presets: ['babel-preset-expo'], presets: [
[
'babel-preset-expo',
{
lazyImports: true,
},
],
],
plugins: [ plugins: [
[ [
'module:react-native-dotenv', 'module:react-native-dotenv',

View File

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