ember-cli-cordova
ember-cli-cordova copied to clipboard
Configuration based way to know if you are building with Cordova
Ember CLI Electron sets an environment variable so you can have your app behave differently depending on the type of build :
// environment.js
module.exports = function(environment) {
var ENV = {/*...*/};
if (process.env.EMBER_CLI_ELECTRON) {
ENV['locationType'] = 'hash';
// ...
}
return ENV;
};
I know the EMBER_CLI_CORDOVA
env var is used when you need to build without Cordova. I'd like to be able to configure my app to opt-in instead of opt-out :
// environment.js
module.exports = function(environment) {
var ENV = {
cordova: {
rebuildOnChange: false,
emulate: false,
enabledByDefault: false // or something...
},
};
if (process.env.EMBER_CLI_CORDOVA) {
ENV['locationType'] = 'hash';
// ...
}
return ENV;
};
This could also improve how https://github.com/poetic/ember-cli-cordova/pull/87 is implemented.
Is this something that can already be done another way?