-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetro.config.js
More file actions
35 lines (28 loc) · 1.24 KB
/
metro.config.js
File metadata and controls
35 lines (28 loc) · 1.24 KB
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
// filepath: /home/shobhin/Documents/sc2-mobile-app/metro.config.js
// Extend Expo's default Metro config so expo-doctor recognizes the file
// Also include a small polyfill for Array.prototype.toReversed to avoid
// crashes when running with older Node versions (some setups still use Node 18).
if (!Array.prototype.toReversed) {
Object.defineProperty(Array.prototype, 'toReversed', {
configurable: true,
enumerable: false,
writable: true,
value: function toReversed() {
return Array.prototype.slice.call(this).reverse();
},
});
}
const { getDefaultConfig } = require('expo/metro-config');
// Get the default config from Expo
const config = getDefaultConfig(__dirname);
// Ensure resolver exists
config.resolver = config.resolver || {};
// Safely add 3D model asset extensions without duplicating
const existingAssetExts = Array.isArray(config.resolver.assetExts)
? config.resolver.assetExts
: [];
const extraExts = ['glb', 'gltf', 'obj', 'mtl', 'fbx', 'csv'];
config.resolver.assetExts = Array.from(new Set([...existingAssetExts, ...extraExts]));
// Prefer react-native exports to suppress some package.json export warnings
config.resolver.resolverMainFields = ['react-native', 'browser', 'main'];
module.exports = config;