-
Notifications
You must be signed in to change notification settings - Fork 7
/
metro.config.js
42 lines (39 loc) · 1.35 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
41
42
const { mergeConfig } = require("@react-native/metro-config");
const { getSentryExpoConfig } = require("@sentry/react-native/metro");
// eslint-disable-next-line no-undef
const defaultConfig = getSentryExpoConfig(__dirname, {
// [Web-only]: Enables CSS support in Metro.
isCSSEnabled: true,
});
const converseMetroConfig = {
...defaultConfig,
transformer: {
...defaultConfig.transformer,
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
minifierPath: "metro-minify-terser",
minifierConfig: {
// Terser options...
},
babelTransformerPath: require.resolve("react-native-svg-transformer"),
},
resolver: {
...defaultConfig.resolver,
assetExts: defaultConfig.resolver.assetExts.filter((ext) => ext !== "svg"),
// Expo 49 issue: default metro config needs to include "mjs"
// https://github.com/expo/expo/issues/23180
sourceExts: [...defaultConfig.resolver.sourceExts, "svg", "mjs"],
extraNodeModules: {
...require("expo-crypto-polyfills"),
// crypto: require.resolve("react-native-quick-crypto"),
zlib: require.resolve("browserify-zlib"),
},
unstable_enablePackageExports: true,
unstable_conditionNames: ["react-native", "browser", "require"],
},
};
module.exports = converseMetroConfig;