Closed blimmer closed 10 years ago
The standard practice for Ember.ENV flags looks something like
<script>
ENV = {
I18N_COMPILE_WITHOUT_HANDLEBARS: true,
SOME_OTHER_FLAG: 'debug'
};
</script>
<script src="/js/vendor.js"></script>
<script src="/js/application.js"></script>
Can you not seed window.ENV
before including vendor.js
for some reason?
Excellent, sorry this must have been my misunderstanding.
EDIT:
As a follow up, I guess I was confused on how to set Ember.ENV
values in general. I didn't realize you could set them on window
. I thought that I would need to have included Ember, then this env variable, then i18n which would have been a pain.
It's awesome that we have a new handlebars-less compiler to use with i18n. However, it was harder than I would have hoped to set the appropriate environment variable to enable it.
According to the README:
That's a bit of a pain because I use Bower to include ember and ember i18n in a vendor.js file (produced by brunch). Therefore, I had to create a single line fine to include before ember i18n that sets this environment variable and include it in an ordering directive.
It would be great if I could set this before calling my
App.create
, like otherEmber.FEATURES
. At the very least, it would be awesome if the message in the console (Ember.I18n will no longer include Handlebars compilation by default in the future; instead, it will supply its own default compiler. Set Ember.ENV.I18N_COMPILE_WITHOUT_HANDLEBARS to true to opt-in now.
) didn't appear in production.