brzpegasus / ember-cli-nwjs

An addon for building desktop apps with Ember and NW.js
MIT License
125 stars 17 forks source link

Facility to create a separate environment for native app #55

Closed shripathee closed 8 years ago

shripathee commented 8 years ago

Right now, we have certain settings exclusively for native app. For e.g: locationType: 'hash'. Is it possible to have a separate environment for native app, which modifies the configuration already present for 'development' or 'production'?

brzpegasus commented 8 years ago

You can either do something like this:

var ENV = {
  locationType: process.env.EMBER_CLI_NW ? 'hash' : 'auto',
  // ...
};

or this:

var ENV = {
  // common config
};

if (process.env.EMBER_CLI_NW) {
  // override settings for NW.js
}

or introduce a new environment altogether in your config/environment.js:

var ENV = {
  // common config
};

if (environment === 'nwjs') {
  // override settings for NW.js  
}

But if you do the latter, you'll have to run all the ember nw[:*] commands with --environment=nwjs.

shripathee commented 8 years ago

Thanks. It would be nice if the above can be added to the README since this is a fairly common use case.