New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for new targets feature in ember-cli. #34
Conversation
See: * https://github.com/ember-cli/rfcs/blob/master/complete/0095-standardise-targets.md * https://emberjs.com/blog/2017/03/19/ember-2-12-released.html#toc_targets On older ember-cli versions `project.targets` is undefined, which would cause the default autoprefixer results (same as prior to this change). On newer ember-cli versions the projects own targets are used and manual configuration in `ember-cli-build.js` is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@@ -6,20 +6,25 @@ var defaults = require('lodash/defaults'); | |||
|
|||
module.exports = { | |||
name: 'ember-cli-autoprefixer', | |||
included: function(app, parentAddon) { | |||
|
|||
included: function(app) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're node 4 we can use shorthand syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, but that sounds like something that should be handled separately.
this.options = defaults(this.app.options.autoprefixer || {}, { | ||
browsers: this.project.targets && this.project.targets.browsers, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's super convenient that both use the same syntax.
How complex would be to add a smoke test that uses two fixtures and mimics the addon being invoked with different targets to see that the output is different? |
@kimroen - Friendly ping 😸 |
Thank you so much - good work everyone! Released as |
See:
On older ember-cli versions
project.targets
is undefined, which would cause the default autoprefixer results (same as prior to this change).On newer ember-cli versions the projects own targets are used and manual configuration in
ember-cli-build.js
is not needed.Closes #32.