ionic-team / ionic-app-scripts

App Build Scripts for Ionic Projects
http://ionicframework.com/
MIT License
609 stars 300 forks source link

"Environments" section of repo results in "ReferenceError" in new v4 app #1531

Open josh-m-sharpe opened 5 years ago

josh-m-sharpe commented 5 years ago

Short description of the problem:

I've been attempting to include env variables from .env.dev using this section of the README. However I get the error ReferenceError: process is not defined when viewing my app in a browser.

Steps to reproduce: I created a repo, so you can see the commits:

https://github.com/josh-m-sharpe/env_vars

Pretty straight forward:

1) new v4 app 2) create src/declarations.d.ts 3) create .env.dev 4) add console.log(process.env.MY_VAR) in src/app/home/home.page.ts 5) ionic serve

Which @ionic/app-scripts version are you using? 4.0