forked from bitovi/jquerypp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
56 lines (49 loc) · 1.3 KB
/
build.js
File metadata and controls
56 lines (49 loc) · 1.3 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
load("build/underscore.js");
var _ = this._;
load("steal/rhino/rhino.js");
steal('steal/build/pluginify', 'steal/build/amdify', 'steal/build/extract', function () {
// Use with ./js can/build/dist.js <outputfolder> <version> <library1> <library2>
var version = _args[1] || 'edge';
var outFolder = (_args[0] || 'jquerypp/dist/') + version + '/';
var outFile = outFolder + 'jquerypp';
var buildFile = 'jquerypp/build/lib.js';
var options = {
exclude: ["jquery", "jquery/jquery.js", "jquerypp/build/lib.js"],
wrapInner: ['(function(window, $, undefined) {\n', '\n})(this, jQuery);']
};
/**
* Build jQuery++
*/
var build = function () {
var defaults = {
out: outFile + '.js',
onefunc: true,
compress: false,
skipAll: true
};
steal.build.pluginify(buildFile, _.extend(defaults, options));
steal.build.pluginify(buildFile, _.extend(defaults, options, {
minify: true,
out: outFile + '.min.js'
}));
};
/**
* Build the AMD module distributable
*/
var buildAmd = function () {
steal.build.amdify(buildFile, {
out: outFolder + '/amd',
exclude: options.exclude
});
};
var extractFiles = function () {
steal.build.extract(buildFile, {
out: outFolder + 'raw',
exclude: options.exclude
});
}
steal.File(outFolder).mkdirs();
build();
buildAmd();
extractFiles();
});