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?
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With