-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js
34 lines (31 loc) · 897 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* jshint node: true */
'use strict';
//var debug = require('broccoli-stew').debug;
var RTLRewrite = require('./broccoli-rtl-filter');
var BroccoliMergeTrees = require('broccoli-merge-trees');
module.exports = {
name: 'ember-cli-rtlcss',
isDevelopingAddon: function() {
return true;
},
initializeOptions: function() {
this.options = {
enabled: true //this.app.env === 'production',
};
},
postprocessTree: function (type, inputNodes) {
if (type === 'css' ) {
//console.info('ember-cli-rtlcss:postprocessTree', type);
var rtlNodes = new RTLRewrite(inputNodes);
var merged = new BroccoliMergeTrees([inputNodes, rtlNodes], {overwrite:true});
return merged;
//return debug(merged, {name:'css-tree'});
}else{
return inputNodes;
}
},
included: function (app) {
this.app = app;
this.initializeOptions();
},
};