Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

196
Views
Building an ionic 2/cordova app on PhoneGap in production mode

CONTEXT

  • I am building a Cordova / Ionic 2 application for iOS.
  • The application is built on PhoneGap build website to generate the ipa.
  • The application is generated successfully and I can launch the application

PROBLEM

I defined some configurations for development and for production using

process.env.IONIC_ENV === 'prod' switch in one of my angular module file. But when i'm running the application, it's clearly running the development configuration.

I also uncompressed and checked the resulting ipa www/build/main.js file and went to look for my environment module.

The snippet that was looking for the environment variable which was originally

useValue: process.env.IONIC_ENV === 'prod' ? ProdEnv : DevEnv

Had been converted to:

useValue: false ? ProdEnv : __WEBPACK_IMPORTED_MODULE_2__environment_dev__

It clearly show me that the preprocessor runned and converted the check into false, which imply that my build is not running with the IONIC_ENV set to 'prod'

QUESTION

How do I make Phonegap build build my iOS application in production mode?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

PhoneGap Build builds each native mobile app using the exact code files you give it - there's no concept of "dev" vs. "prod". Based on the reference to "process.env.IONIC_ENV", I'm guessing you're using Ionic's App Scripts to precompile your app. I'm not familiar with them, but based on the available tasks, you'd run: build --prod before uploading the code to PhoneGap Build.

PhoneGap Build does have an API, so technically you could "make" Build create your app in production mode by using those scripts plus your own to "build --prod" then upload the app via their API.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!