-
Notifications
You must be signed in to change notification settings - Fork 34
/
metro.config.js
30 lines (26 loc) · 1 KB
/
metro.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');
const { resolve } = require('path');
/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname);
config.transformer = {
...config.transformer,
minifierConfig: {
drop_console: true,
},
babelTransformerPath: require.resolve('react-native-svg-transformer/expo'),
};
config.resolver = {
...config.resolver,
assetExts: config.resolver.assetExts.filter((ext) => ext !== 'svg'),
sourceExts: [...config.resolver.sourceExts, 'svg'],
};
config.resolver.resolveRequest = (context, moduleName, platform) => {
if (moduleName.startsWith('kitsu/') || moduleName.startsWith('@/')) {
const resolved = resolve(moduleName.replace(/^(kitsu|@)\//i, './src/'));
return context.resolveRequest(context, resolved, platform);
}
// Ensure you call the default resolver.
return context.resolveRequest(context, moduleName, platform);
};
module.exports = config;