const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const path = require('path');
const defaultConfig = getDefaultConfig(__dirname);
// Add support for SVG transformer (your existing config)
defaultConfig.transformer = {
  ...defaultConfig.transformer,
  babelTransformerPath: require.resolve('react-native-svg-transformer'),
};

defaultConfig.resolver = {
  ...defaultConfig.resolver,
  // Remove 'svg' from assets (so it's treated as source for transformer)
  assetExts: defaultConfig.resolver.assetExts.filter((ext) => ext !== 'svg'),
  // Add 'svg' to source files
  sourceExts: [...defaultConfig.resolver.sourceExts, 'svg'],
  // ✅ Add 'tflite' to asset extensions (critical for bundling .tflite models)
  assetExts: [...defaultConfig.resolver.assetExts.filter((ext) => ext !== 'svg'), 'tflite'],
};

module.exports = mergeConfig(defaultConfig, {
  watchFolders: [path.resolve(__dirname, 'node_modules')],
  // 🔥 Fix for Windows "Failed to start watch mode"
  
});