2023-03-13 22:01:43 +01:00
|
|
|
// Learn more https://docs.expo.io/guides/customizing-metro
|
|
|
|
const {getDefaultConfig} = require('expo/metro-config')
|
2023-03-31 20:17:26 +02:00
|
|
|
const cfg = getDefaultConfig(__dirname)
|
2023-10-27 02:54:15 +02:00
|
|
|
|
2023-03-31 20:17:26 +02:00
|
|
|
cfg.resolver.sourceExts = process.env.RN_SRC_EXT
|
|
|
|
? process.env.RN_SRC_EXT.split(',').concat(cfg.resolver.sourceExts)
|
|
|
|
: cfg.resolver.sourceExts
|
2023-10-27 02:54:15 +02:00
|
|
|
|
|
|
|
cfg.transformer.getTransformOptions = async () => ({
|
|
|
|
transform: {
|
2023-10-30 22:54:23 +01:00
|
|
|
experimentalImportSupport: true,
|
2023-10-27 02:54:15 +02:00
|
|
|
inlineRequires: true,
|
2023-10-30 22:54:23 +01:00
|
|
|
nonInlinedRequires: [
|
|
|
|
// We can remove this option and rely on the default after
|
|
|
|
// https://github.com/facebook/metro/pull/1126 is released.
|
|
|
|
'React',
|
|
|
|
'react',
|
|
|
|
'react/jsx-dev-runtime',
|
|
|
|
'react/jsx-runtime',
|
|
|
|
'react-native',
|
|
|
|
],
|
2023-10-27 02:54:15 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2023-03-31 20:17:26 +02:00
|
|
|
module.exports = cfg
|