-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
metro.config.js.template
39 lines (38 loc) · 1.3 KB
/
metro.config.js.template
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
const { withNxMetro } = require('@nrwl/react-native');
const { getDefaultConfig } = require('metro-config');
const exclusionList = require('metro-config/src/defaults/exclusionList');
module.exports = (async () => {
const {
resolver: { sourceExts, assetExts },
} = await getDefaultConfig();
return withNxMetro(
{
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
babelTransformerPath: require.resolve('react-native-svg-transformer'),
},
resolver: {
assetExts: assetExts.filter((ext) => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg'],
resolverMainFields: ['sbmodern', 'browser', 'main'],
blockList: exclusionList([/\.\/dist\/.*/]),
},
},
{
// Change this to true to see debugging info.
// Useful if you have issues resolving modules
debug: false,
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx', 'json'
extensions: [],
// the project root to start the metro server
projectRoot: __dirname,
// Specify folders to watch, in addition to Nx defaults (workspace libraries and node_modules)
watchFolders: []
}
);
})();