forked from west2-online/fzuhelper-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetro.config.js
More file actions
29 lines (25 loc) · 1009 Bytes
/
Copy pathmetro.config.js
File metadata and controls
29 lines (25 loc) · 1009 Bytes
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
const { getDefaultConfig } = require('expo/metro-config');
const { withNativeWind } = require('nativewind/metro');
let config = getDefaultConfig(__dirname);
{
const { transformer, resolver } = config;
// 配置 transformer 和 resolver
config.transformer = {
...transformer,
babelTransformerPath: require.resolve('react-native-svg-transformer/expo'),
};
config.resolver = {
...resolver,
assetExts: resolver.assetExts.filter(ext => ext !== 'svg'), // 移除默认的 SVG 解析方法
sourceExts: [...resolver.sourceExts, 'svg'], // 添加 SVG 支持
// https://github.com/expo/expo/issues/43614#issuecomment-3992041354
resolveRequest: (context, moduleName, platform) => {
if (moduleName.includes('MaterialSymbols')) {
return { type: 'empty' };
}
return context.resolveRequest(context, moduleName, platform);
},
};
}
// 将 `nativewind` 配置应用到 Metro 配置中
module.exports = withNativeWind(config, { input: './global.css' });