Comments (2)
Sorry I haven't gotten back to you on this one! I just updated the README
If more than dev
and prod
environments are wanted, there are a few things you will need to do.
- Change your
optimization.config.js
andwebpack.config.js
IONIC_ENV
variable to be something else. For example:
'./src/environments/environment' + (process.env.MY_ENV === 'prod' ? '' : '.' + process.env.MY_ENV) + '.ts'
- Add to your
package.json
another run script and name it whatever you would like
"serve:testing": "MY_ENV=testing ionic-app-scripts serve"
- Create your testing file
src/environments/environment.testing.ts
. This should be whatever you set yourMY_ENV
to. - Finally, run the script by using the name you used for your script in
package.json
$ npm run serve:testing
from ionic-environment-variables.
How do I run it for android and ios build?
from ionic-environment-variables.
Related Issues (20)
- The Angular AoT build failed. typescript error HOT 8
- How to use with Unit testing with Karma HOT 6
- Cannot find module '@app/env'. HOT 7
- Can not find '@app/env' when running 'ionic cordova build ios' HOT 8
- TypeError: Cannot read property 'resolve' of undefined HOT 4
- Environment folder outside Angular
- Custom environment other than IONIC_ENV, is not recognized as an internal or external command HOT 2
- How to ionic serve --prod? HOT 2
- using environment variables with live deploy HOT 1
- When I build with params MY_ENV=dev and --prod, ionic builds with the prod environment. HOT 3
- Everytime its load the last environment file
- Not working HOT 3
- Cannot find module ''@app/env" only at first run
- Loading environment variables when no `environment.XXX.ts` present
- Error: Cannot find module "@app/env" HOT 4
- Production env doesn't work with run livereload
- Updating env file with new attribute is not picked up by build or serve HOT 1
- No example in how to write the enviroment variable itself HOT 1
- Error: The Angular AoT build failed
- Building Ionic for Browser --
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ionic-environment-variables.