-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
39 lines (29 loc) · 843 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
35
36
37
38
39
var Plugin = require('broccoli-plugin');
var chalk = require('chalk');
var elmCss = require('elm-css');
var log = console.log;
ElmCssPlugin.prototype = Object.create(Plugin.prototype);
ElmCssPlugin.constructor = ElmCssPlugin;
function ElmCssPlugin(inputNodes, _options) {
var options = _options || {};
if (!(this instanceof ElmCssPlugin)) {
return new ElmCssPlugin(options);
}
Plugin.call(this, [inputNodes]);
}
ElmCssPlugin.prototype.build = function() {
return elmCss(
process.cwd(),
"elm/Stylesheets.elm",
this.outputPath,
"Stylesheets",
"files",
undefined
).then(function(results) {
var filesCreated = results.map(function(result) {
return chalk.blue(result.filename);
});
log('broccoli-elm-css created', filesCreated.join(', '));
});
};
module.exports = ElmCssPlugin;