-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetro.config.js
More file actions
33 lines (27 loc) · 902 Bytes
/
Copy pathmetro.config.js
File metadata and controls
33 lines (27 loc) · 902 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
30
31
32
33
// metro.config.js
const { getDefaultConfig } = require('expo/metro-config');
const path = require('path');
let config = getDefaultConfig(__dirname);
// Custom asset extensions; ensure 'ksx' and 'txt' are present
// and remove duplicates if getDefaultConfig already includes them.
const defaultAssetExts = config.resolver.assetExts;
config.resolver.assetExts = [
...defaultAssetExts.filter((ext) => ext !== 'ksx' && ext !== 'txt'),
'ksx',
'txt',
];
// Transformer configuration
config.transformer.getTransformOptions = async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
});
// Alias configuration
const nanoidMockPath = path.resolve(__dirname, 'src/utils/nanoidMock.js');
config.resolver = config.resolver || {};
config.resolver.alias = {
...(config.resolver.alias || {}),
'nanoid/non-secure': nanoidMockPath,
};
module.exports = config;