Repository navigation
Conversation
```javascript
var app = new EmberApp({
productionEnvironments: [ 'production', 'staging' ]
});
```
|
-1 lets not introduce another flag we will break soon aswe have plans (@domme's work) to improve this area |
|
Then ship the other thing. |
|
For those that need this the following works now, Stef wants you to feel pain: var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var isProductionLikeBuild = ['production', 'staging'].indexOf(process.env.EMBER_ENV) > -1;
var app = new EmberApp({
wrapInEval: !isProductionLikeBuild,
minifyCSS: {
enabled: isProductionLikeBuild
},
minifyJS: {
enabled: isProductionLikeBuild
},
tests: !isProductionLikeBuild,
hinting: !isProductionLikeBuild,
vendorFiles: {
'handlebars.js': {
staging: 'bower_components/handlebars/handlebars.runtime.js'
},
'ember.js': {
staging: 'bower_components/ember/ember.prod.js'
}
}
}); |
|
stef has also provided a thoughtful proposal to get us out of this local min https://gist.github.com/rwjblue/51f1df4b21a23466ae47 @dschmidt has also started to implement #1520 and can likely use a hand. |
|
In the workaround above, right? @rwjblue EDIT: var app = new EmberApp({
...
fingerprint: {
enabled: isProductionLikeBuild
}
}); |
|
@regularjack - Ooops, yes, updated (thanks for catching). |
|
@rwjblue Has this situation improved at all? |
|
@devinus nope, we have not worked on the configuration story yet |
|
Ha, I just wrote something very similar to what @rwjblue wrote for my app. It might be worth updating the core docs under "environment" to make it clear that different environments aren't supported and that you should stick to the core dev/test/prod. I very much like the idea of a set of config flags that could be imported/reused by other configurations. For example, we'd take a "production" config and modify it slightly for staging. Ping me if someone else is working on this currently and could use some help. |
|
@skylar would you be able to share how you achieved this? I haven't been able to get the code above working for me. Thanks in advance! |
|
@KaiFuglem ha - yes, I forgot I had done this. In any case, I put my |
|
Why couldn't we get something like this until this huge refactor lands? |
|
@devinus do you have a PR? |
|
@skylar We're on the PR. |
|
Thanks @skylar! That worked for me, but for those still having issues implementing this, I also had to modify an app.import: app.import({
development: 'xxx-debug.js',
production: 'xxx.js',
staging: 'xxx.js'
}); |
|
I really would love to see some kind of support like @rwjblue mentioned way back at the start of this issue. I've run into 3 subtle problems today that caused deployment headaches because of differences between my staging and production environments. In my workflow, staging should be just like production so I can catch bugs before I deploy to prod. Since I use ember-cli-deploy-redis the new versions aren't activated until I explicitly say so, however it's really unsettling to test everything/accept stories on staging and then find (multiple) bugs in production caused by build differences. I currently have 11 instances of flipping the switch based on |
|
I would recommend, people stick to the 3 main envs, and use ENV vars (Accessible inside the builld and the config/environment.js to configure further. This allows addons to understand the intent of a given ENV. I plan to also the concept of --target (ios/embedded/electron etc.etc.) the 3x3 matrix + ENV var channel should handle most cases. While allowing common addons/tooling to understand the intent. Staging, would be production + different ENV vars specifying specific endpoints/domains etc) |
|
@blimmer I have/had the same pain point with ember-cli & ember-cli-deploy and was using the switches until I ran into a couple plugins that internally based things on It feels confusing to type out, but I'd be glad to talk on slack/wherever if you want more code or a better-thought-out explanation. |
|
@stefanpenner I ran into this again today with a bug report we should have caught in staging. are there any updates wrt this problem? should I submit an RFC to get more feedback? I would really like to help figure out a solution for this issue. |
The following is all that is needed to enable building
stagingas anotherproductiontype environment: