diff --git a/README.md b/README.md index a703ffa..e97ede4 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,9 @@ ember install ember-cli-autoprefixer ``` ## Options -You can configure what browsers to target and other options by specifying them in your -`ember-cli-build.js` (or `Brocfile.js`). An example: +By default ember-cli-autoprefixer passes your projects target browsers (in Ember CLI >= 2.13.0) +to autoprefixer. However, you can manually configure what browsers to target and other options by +specifying them in your `ember-cli-build.js` (or `Brocfile.js`). An example: ```js var app = new EmberApp(defaults, { diff --git a/index.js b/index.js index 05ba78e..eac1b4f 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,8 @@ var defaults = require('lodash/defaults'); module.exports = { name: 'ember-cli-autoprefixer', - included: function(app, parentAddon) { + + included: function(app) { this.app = app; if (typeof app.import !== 'function' && app.app) { @@ -14,12 +15,16 @@ module.exports = { } this._super.included.apply(this, arguments); + this.options = defaults(this.app.options.autoprefixer || {}, { + browsers: this.project.targets && this.project.targets.browsers, enabled: true }); + this.enabled = this.options.enabled; delete this.options.enabled; }, + postprocessTree: function(type, tree) { if ((type === 'all' || type === 'styles') && this.enabled) { tree = autoprefixer(tree, this.options);