Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ember-cli meta config/environment file

I'm using ember-cli to structure my app.

It compiles all the files to the dist/ directory.

However as I inspected the compiled index.html I noticed it was creating this meta tag.

<meta name="user/config/environment" content="%7B%22modulePrefix%22%3A%22user%22%2C%22environment%22%3A%22development%22%2C%22baseURL%22%3A%22/%22%2C%22locationType%22%3A%22auto%22%2C%22contentSecurityPolicy%22%3A%7B%22default-src%22%3A%22%27none%27%20localhost%22%2C%22script-src%22%3A%22%27self%27%20%27unsafe-inline%27%20%27unsafe-eval%27%20use.typekit.net%20connect.facebook.net%20maps.googleapis.com%20maps.gstatic.com%22%2C%22font-src%22%3A%22%27self%27%20data%3A%20use.typekit.net%22%2C%22connect-src%22%3A%22%27self%27%20localhost%22%2C%22img-src%22%3A%22%27self%27%20www.facebook.com%20p.typekit.net%22%2C%22style-src%22%3A%22%27self%27%20%27unsafe-inline%27%20use.typekit.net%22%2C%22frame-src%22%3A%22s-static.ak.facebook.com%20static.ak.facebook.com%20www.facebook.com%22%7D%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%7D%2C%22APP%22%3A%7B%22LOG_ACTIVE_GENERATION%22%3Atrue%2C%22LOG_VIEW_LOOKUPS%22%3Atrue%7D%2C%22exportApplicationGlobal%22%3Atrue%7D">

This is a problem for my deployment as I'm currently using the ember-app within another page and this meta tag is needed for the ember app to work. Is there a way to make this as part of the javascript compiled file or get rid of this altogether?

like image 492
user391986 Avatar asked Oct 26 '14 19:10

user391986


People also ask

Do I need to configure my Ember CLI app?

While Ember gives you strong defaults so that you might never need to configure anything, it still supports configuring your app if you need to! Ember CLI ships with support for managing your application's environment. The runtime environment for the application is defined in config/environment.js.

How do I get the original environment of an ember build?

If you need to have the original environment that was passed into the ember build command, this can be obtained under the environment variable of DEPLOY_TARGET and referenced in any node.js context with process.env.DEPLOY_TARGET. Those contexts include evaluation of your config/deploy.js file and your ember-cli-build.js file.

What is Ember-CLI-deploy?

ember-cli-deploy provides the ember deploy command, some build hooks, and configuration files to your project. There are many ember-cli-deploy plugins that help you deploy to many different destinations and web hosting services, such as AWS S3 or GitHub pages.


1 Answers

The ability to build your app without this was recently added in this PR

You can set it up to be in your compiled JS output by passing in the storeConfigInMeta option. To opt-out, it should look like this in your Brocfile.js

/* global require, module */

var EmberApp = require('ember-cli/lib/broccoli/ember-app');

var app = new EmberApp({
  storeConfigInMeta: false
});

module.exports = app.toTree();

This is available in ember-cli 0.1.2 which is the latest version right now

like image 178
jakecraige Avatar answered Oct 21 '22 09:10

jakecraige