-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetro.config.js
More file actions
32 lines (26 loc) · 828 Bytes
/
metro.config.js
File metadata and controls
32 lines (26 loc) · 828 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
/*
* Copyright (c) 2025 Amazon.com, Inc. or its affiliates. All rights reserved.
*
* PROPRIETARY/CONFIDENTIAL. USE IS SUBJECT TO LICENSE TERMS.
*/
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const crypto = require('crypto');
const fs = require('fs');
function hashFileContent(filePath, hashName = 'sha256') {
if (!fs.existsSync(filePath)) {
return;
} else {
const hash = crypto.createHash(hashName);
hash.update(fs.readFileSync(filePath));
return hash.digest('hex');
}
}
const cacheVersion = hashFileContent('.env');
/**
+ * Metro configuration
+ * https://facebook.github.io/metro/docs/configuration
*
+ * @type {import('metro-config').MetroConfig}
*/
const config = { cacheVersion };
module.exports = mergeConfig(getDefaultConfig(__dirname), config);