fix: conditionally load TV plugin based on build target

Moves TV-specific plugin configuration from static app.json to dynamic loading in app.config.js based on EXPO_TV environment variable.

Ensures TV plugin only loads for TV builds while phone-specific plugins load for non-TV builds, preventing conflicts between different build targets.
This commit is contained in:
Uruk
2025-09-26 19:41:51 +02:00
parent edc9c8640d
commit 84d7ad72a6
2 changed files with 5 additions and 2 deletions

View File

@@ -1,5 +1,9 @@
module.exports = ({ config }) => {
if (process.env.EXPO_TV !== "1") {
if (process.env.EXPO_TV === "1") {
// Add TV-specific plugin for TV builds
config.plugins.push("@react-native-tvos/config-tv");
} else {
// Add non-TV specific plugins for phone builds
config.plugins.push("expo-background-task");
config.plugins.push([

View File

@@ -53,7 +53,6 @@
"googleServicesFile": "./google-services.json"
},
"plugins": [
"@react-native-tvos/config-tv",
"expo-router",
"expo-font",
[