-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetro.config.cjs
46 lines (38 loc) · 1.18 KB
/
metro.config.cjs
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
43
44
45
46
/* eslint-env node */
/* eslint-disable @typescript-eslint/no-var-requires */
const { getDefaultConfig } = require('expo/metro-config');
const { withNativeWind } = require('nativewind/metro');
const defaultConfig = getDefaultConfig(__dirname);
defaultConfig.transformer.getTransformOptions = async () => ({
transform: {
// Disabled experimental tree shaking because it breaks nativewind
experimentalImportSupport: false,
inlineRequires: false,
},
});
/**
* Adds Lingui metro transformer to allow for .po/.pot files to be imported
*
* @see https://lingui.dev/ref/metro-transformer
* @param {import('expo/metro-config').MetroConfig} config
* @returns {import('expo/metro-config').MetroConfig}
*/
function withLingui(config) {
config.transformer = {
...config.transformer,
babelTransformerPath: require.resolve('@lingui/metro-transformer/expo'),
};
config.resolver = {
...config.resolver,
sourceExts: [...config.resolver.sourceExts, 'po', 'pot'],
};
return config;
}
const config = withLingui(
withNativeWind(defaultConfig, {
input: './src/app/global.css',
configPath: './tailwind.config.ts',
inlineRem: 16,
})
);
module.exports = config;