-
Notifications
You must be signed in to change notification settings - Fork 24
/
metro.config.js
40 lines (36 loc) · 1.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
31
32
33
34
35
36
37
38
39
40
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
* with added config for react-native-svg-transformer
* https://www.npmjs.com/package/react-native-svg-transformer?activeTab
*
* @format
*/
const { getDefaultConfig, mergeConfig } = require( "@react-native/metro-config" );
const {
resolver: { sourceExts, assetExts }
} = getDefaultConfig();
const localPackagePaths = [
// If you reference any local paths in package.json, you'll need to list them here
];
/**
* Metro configuration
* https://facebook.github.io/metro/docs/configuration
*
* @type {import('metro-config').MetroConfig}
*/
const config = {
transformer: {
babelTransformerPath: require.resolve( "react-native-svg-transformer" )
},
resolver: {
assetExts: assetExts.filter( ext => ext !== "svg" ),
sourceExts:
process.env.MOCK_MODE === "e2e"
? ["e2e-mock", ...sourceExts, "svg"]
: [...sourceExts, "svg"],
nodeModulesPaths: [...localPackagePaths]
},
watchFolders: [...localPackagePaths]
};
module.exports = mergeConfig( getDefaultConfig( __dirname ), config );