4
votes

I'm using Ember-CLI for an app that is embedded in a larger Java application:

The idea is having the ember-cli build triggered by the main app and then the resources in dist are copied over the main one where it will be served from the server as static resources.

The problem I have is that Ember-CLI injects the configuration defined in environment.js as a tag in the generated index.html like this:

<meta name="user/config/environment" content="%7B%22modulePre.your.config">

I'm not using the index.html, but a jsp with more data from the main application and the Ember rootElement tag.

This makes the process quite cumbersome because every time the environment.js is changed we have to manually copy the generated meta tag with the new config and put in the jsp.

I was thinking about copying manually the environment.js from the source code in the build project and import it, but was wondering if there is a better alternative to make the configuration available without the html injection?

1

1 Answers

1
votes

Seems like I missed this in the documentation:

new EmberApp({
  storeConfigInMeta: false
});

With this parameter the environment.js properties are merged into the final js compiled in production. Duh!