Skip to content

Commit

Permalink
A new hope
Browse files Browse the repository at this point in the history
  • Loading branch information
kimroen committed Jul 6, 2014
1 parent 1ddc21e commit 3babf88
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
25 changes: 9 additions & 16 deletions index.js
Expand Up @@ -4,31 +4,24 @@ var path = require('path');
var fs = require('fs');
var autoprefixer = require('broccoli-autoprefixer');

function AutoprefixerPlugin(options) {
this.name = 'ember-cli-autoprefixer';
this.ext = 'css';
this.options = options || {};
}

AutoprefixerPlugin.prototype.toTree = function(tree) {
return autoprefixer(tree, this.options);
};

function EmberCLIAutoprefixer(project) {
this.project = project;
this.name = 'Ember CLI Autoprefixer';
}

EmberCLIAutoprefixer.prototype.treeFor = function treeFor() {
EmberCLIAutoprefixer.prototype.postprocessTree = function (type, tree) {
if (type === 'all' || type === 'styles') {
tree = autoprefixer(tree, this.options);
}

return tree;
};

EmberCLIAutoprefixer.prototype.included = function included(app) {
var registry = app.registry;
this.app = app;

var plugin = new AutoprefixerPlugin(this.app.options.autoprefixerOptions);

registry.add('css', plugin);
this.options = this.app.options.autoprefixer;
};

EmberCLIAutoprefixer.prototype.treeFor = function treeFor() {};

module.exports = EmberCLIAutoprefixer;
9 changes: 8 additions & 1 deletion package.json
Expand Up @@ -7,8 +7,15 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"ember-addon"
"ember-addon",
"autoprefixer",
"css",
"prefix",
"preprocess"
],
"ember-addon": {
"before": "broccoli-asset-rev"
},
"author": "Kim Røen",
"license": "MIT",
"dependencies": {
Expand Down

0 comments on commit 3babf88

Please sign in to comment.