Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration based way to know if you are building with Cordova #200

Open
jdurand opened this issue Apr 29, 2016 · 0 comments
Open

Configuration based way to know if you are building with Cordova #200

jdurand opened this issue Apr 29, 2016 · 0 comments

Comments

@jdurand
Copy link

jdurand commented Apr 29, 2016

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 #87 is implemented.

Is this something that can already be done another way?

@jdurand jdurand changed the title Configuration based way to know if we're using Cordova build Configuration based way to know if you are using Cordova build Apr 29, 2016
@jdurand jdurand changed the title Configuration based way to know if you are using Cordova build Configuration based way to know if you are building with Cordova Apr 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant