diff --git a/eas.json b/eas.json index 396f1ecb..9e219849 100644 --- a/eas.json +++ b/eas.json @@ -6,8 +6,14 @@ "development": { "resourceClass": "medium", "cache": { - "key": "development-{{ checksum \"bun.lock\" \"package.json\" }}", - "paths": ["~/.bun/install/cache", "node_modules", ".expo"] + "key": "dev-{{ checksum \"bun.lock\" \"app.config.js\" }}", + "paths": [ + "~/.bun/install/cache", + "node_modules", + ".expo", + "android/.gradle", + "ios/Pods" + ] }, "environment": "development", "developmentClient": true, @@ -55,19 +61,34 @@ "preview": { "resourceClass": "large", "cache": { - "key": "preview-{{ checksum \"bun.lock\" \"package.json\" }}", - "paths": ["~/.bun/install/cache", "node_modules", ".expo"] + "key": "preview-{{ checksum \"bun.lock\" \"app.config.js\" }}", + "paths": [ + "~/.bun/install/cache", + "node_modules", + ".expo", + "android/.gradle", + "ios/Pods", + ".next" + ] }, "distribution": "internal", "env": { + "EXPO_OPTIMIZE_BUNDLE_SIZE": "1", + "NODE_ENV": "production", "EXPO_PUBLIC_WRITE_DEBUG": "1" } }, "production": { "resourceClass": "large", "cache": { - "key": "production-{{ checksum \"bun.lock\" \"package.json\" }}", - "paths": ["~/.bun/install/cache", "node_modules", ".expo"] + "key": "production-{{ checksum \"bun.lock\" \"app.config.js\" }}", + "paths": [ + "~/.bun/install/cache", + "node_modules", + ".expo", + "android/.gradle", + "ios/Pods" + ] }, "environment": "production", "channel": "0.36.0", @@ -77,6 +98,10 @@ }, "ios": { "image": "latest" + }, + "env": { + "EXPO_OPTIMIZE_BUNDLE_SIZE": "1", + "NODE_ENV": "production" } }, "production-apk": { diff --git a/metro.config.js b/metro.config.js index d58031f7..fcf9b7d3 100644 --- a/metro.config.js +++ b/metro.config.js @@ -29,22 +29,28 @@ config.transformer = { // NEW: Inline requires for 15-30% startup improvement inlineRequires: true, - // NEW: Minification optimized for streaming apps + // ADVANCED: Hermes-optimized minification for streaming apps minifierConfig: { - // Keep function names in dev for better debugging - keep_fnames: process.env.NODE_ENV === "development", mangle: { keep_fnames: process.env.NODE_ENV === "development", - // Optimize for Hermes bytecode - properties: false, // Safer for dynamic property access in streaming }, - // Compress optimized for media apps + output: { + ascii_only: true, + beautify: false, + semicolons: false, + }, compress: { - // Remove console logs in production + // Production-only optimizations drop_console: process.env.NODE_ENV === "production", + dead_code: true, + drop_debugger: true, + conditionals: true, + evaluate: true, + unused: true, + reduce_vars: true, // Keep class names for error reporting keep_classnames: true, - // Preserve function names for performance profiling + // Preserve function names for performance profiling in dev keep_fnames: process.env.NODE_ENV === "development", }, },