forked from guardian/scribe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plumbing.js
41 lines (36 loc) · 1.08 KB
/
Plumbing.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
40
41
/*
* Warning: shameless self-plug!
* Plumber is the Guardian’s tool of choice for build systems.
* https://github.com/plumberjs/plumber
*/
var all = require('plumber-all');
// var bower = require('plumber-bower');
var glob = require('plumber-glob');
var requireJS = require('plumber-requirejs');
var uglifyJS = require('plumber-uglifyjs')();
var write = require('plumber-write');
module.exports = function (pipelines) {
var mainRequireJS = requireJS({
// FIXME: auto?
preserveLicenseComments: false,
paths: {
'lodash-amd': '../bower_components/lodash-amd',
'immutable': '../bower_components/immutable'
}
});
var toBuildDir = write('./build');
var writeBoth = all(
[uglifyJS, toBuildDir],
toBuildDir
);
/* jshint -W069 */
pipelines['build'] = [
// TODO: use bower operation to find main of this component?
// As per: https://github.com/bower/bower/issues/1090
// bower('scribe'),
glob('./src/scribe.js'),
mainRequireJS,
// Send the resource along these branches
writeBoth
];
};