-
Notifications
You must be signed in to change notification settings - Fork 5
/
Jakefile.js
39 lines (28 loc) · 1.08 KB
/
Jakefile.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
'use strict';
/*global fail:false, complete:false, desc:false, jake:false, namespace:false, task:false */
var path = require('path');
var child_process = require('child_process');
var REQUIREJS = path.resolve(__dirname, 'node_modules/requirejs/bin/r.js');
desc('Default - build all dist versions');
task('default', ['dist-all'], function (params) { });
function runRequireJs(argStr) {
var proc = child_process.spawn(REQUIREJS, argStr.split(' '));
proc.stdout.pipe(process.stdout);
proc.stderr.pipe(process.stderr);
proc.on('exit', function (exitCode) {
if (exitCode !== 0) {
console.error('Child process exited with error code: %s, exiting', exitCode);
process.exit(exitCode);
}
});
}
desc('Create core single-file developer dist');
task('dist', function () {
runRequireJs('-o src/dist.build.requirejs out=dist/autoflow.js');
});
desc('Create full single-file minified dist');
task('min', function () {
runRequireJs('-o src/dist.build.requirejs out=dist/autoflow.min.js optimize=uglify');
});
desc('Create all dist versions');
task('dist-all', ['dist', 'min']);