-
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.02 KB
/
Copy pathmetro.config.js
File metadata and controls
35 lines (28 loc) · 1.02 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
// metro.config.js
const { getDefaultConfig } = require('expo/metro-config');
const path = require('path');
let config = getDefaultConfig(__dirname);
// Custom asset extensions; ensure 'ksx' is present
// and remove duplicates if getDefaultConfig already includes them.
const defaultAssetExts = config.resolver.assetExts;
config.resolver.assetExts = [
...defaultAssetExts.filter((ext) => ext !== 'ksx'), // Remove 'ksx' when already present to avoid duplicates
'ksx', // Add 'ksx' when it is missing
];
// Transformer configuration
config.transformer.getTransformOptions = async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
});
// Add this option for Node 18
config.resolver.resolverMainFields = ['browser', 'main'];
// 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;