Flatpak-ing .env files for javascript and electron

I have an electron app, which mostly works. It uses flatpak for packaging, but it is essentially a javascript application. I have an ‘.env’ file. Whatever I set my variables to in the .env file is used by the app.

When I change this file after flatpak packaging, the changes are not propigated to the app. The app sees these environment variables as somehow frozen.

When I change the environment variables before packaging I can see the new variables being used by my app. When I do the packaging I want the environment variables to be filled by ‘export’ commands in my ‘.bashrc’ file. This does not work. Does anyone have any experience here?