mercredi 6 janvier 2016

How to access the environment parameter from ember-cli-build.js

When you do:

ember build --environment="production"

The environment parameter is made available in config/environment.js:

module.exports = function(environment) {
  ...
};

My app has requirements which call for an environment dependent prepend (in ember-cli-build.js):

var STATIC_URL = "TODO";  // This depends on the deploy "environment" parameter

module.exports = function(defaults) {
  var app = new EmberApp(defaults, {
    fingerprint: {
      enabled: true,
      prepend: STATIC_URL,
    },
  });
  return app.toTree();
};

How can I access the environment parameter from ember-cli-build.js?




Aucun commentaire:

Enregistrer un commentaire