Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
kent-williams committed Feb 3, 2025
1 parent 98c4cd1 commit 3b7e1e2
Showing 1 changed file with 7 additions and 37 deletions.
44 changes: 7 additions & 37 deletions metro.config.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,6 @@
// const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config')

// const defaultConfig = getDefaultConfig(__dirname)
// const { assetExts, sourceExts } = defaultConfig.resolver

// /**
// * Metro configuration
// * * https://reactnative.dev/docs/metro
// *
// * @type {import('metro-config').MetroConfig}
// */
// const config = {
// transformer: {
// babelTransformerPath: require.resolve('react-native-svg-transformer'),
// },
// resolver: {
// assetExts: assetExts.filter((ext) => ext !== 'svg'),
// sourceExts: [...sourceExts, 'svg'],
// },
// }

// module.exports = mergeConfig(defaultConfig, config)
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');

const defaultConfig = getDefaultConfig(__dirname);
const { assetExts, sourceExts } = defaultConfig.resolver;

/**
* Metro configuration
* * https://reactnative.dev/docs/metro
*
* @type {import('metro-config').MetroConfig}
*/
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config')
const defaultConfig = getDefaultConfig(__dirname)
const { assetExts, sourceExts } = defaultConfig.resolver
const config = {
transformer: {
babelTransformerPath: require.resolve('react-native-svg-transformer'),
Expand All @@ -43,10 +13,10 @@ const config = {
'iconv-lite/encodings': require.resolve('iconv-lite/encodings'),
},
},
};
}

// Ensure iconv-lite and its encodings are included in the build
const mergedConfig = mergeConfig(defaultConfig, config);
mergedConfig.resolver.assetExts.push('json'); // Include JSON files for encodings
const mergedConfig = mergeConfig(defaultConfig, config)
mergedConfig.resolver.assetExts.push('json') // Include JSON files for encodings

module.exports = mergedConfig;
module.exports = mergedConfig

0 comments on commit 3b7e1e2

Please sign in to comment.