Mahesh J
Mahesh J

Reputation: 520

Release configuration for Ionic project, similar to flavours in Android studio

Been looking into this without any luck. I understand that we can pass configuration to Ionic projects via the config.xml file. But I want to have different configuration for development and release builds.

Does anyone know about how this can be done?

Upvotes: 1

Views: 774

Answers (1)

Aaron Saunders
Aaron Saunders

Reputation: 33335

This is one approach that using the hooks to update a configuration file based on the specific environment you are building for.

You use a configuration variable when executing the cmd as the indicator of the environment.

config_target=qa cordova build --release android ios

then in the hook, check for the variable

var config_target = process.env.config_target || "local"; // default to local

http://www.kdmooreconsulting.com/blogs/build-a-cordova-hook-to-setup-environment-specific-constants/

Upvotes: 1

Related Questions