import createExpoWebpackConfigAsync from "@expo/webpack-config/webpack" ; import { Arguments , Environment } from "@expo/webpack-config/webpack/types" ; import resolveFrom from "resolve-from" ; import { VirtualNavigationPlugin } from "./VirtualNavigationPlugin" ; module . exports = async function ( env , argv ) { let config = await createExpoWebpackConfigAsync ( env , argv ) ; const isNative = [ "ios" , "android" ] . includes ( env . platform ) ; if ( isNative ) { config . plugins ! . push ( new VirtualNavigationPlugin ( { projectRoot : env . projectRoot ?? __dirname , } ) ) ; if ( ! config . resolve ) config . resolve = { } ; if ( ! config . resolve . alias ) config . resolve . alias = { } ; config . resolve . alias [ "@expo/auto-nav" ] = resolveFrom ( env . projectRoot , "./lib/index.ts" ) ; } return config ; } ;