forked from canjs/canjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
88 lines (76 loc) · 1.83 KB
/
build.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
var stealTools = require("steal-tools");
var globalJS = require("steal-tools/lib/build/helpers/global").js;
var ignoreModuleNamesStartingWith = [
"jquery",
"kefir",
'ms-signalr-client',
'prop-types',
'fbjs',
'create-react-class'
];
var ignoreModuleNames = [
'react'
];
var baseNormalize = globalJS.normalize();
var ignoreModules = [function(name){
var foundMatch = ignoreModuleNamesStartingWith.some(function(matchName){
return name.indexOf(matchName) === 0;
})
if(foundMatch) {
return true;
}
foundMatch = ignoreModuleNames.some(function(matchName){
return name.indexOf(matchName+"@") === 0;
});
if(foundMatch) {
return true;
}
return false;
}];
var exportsMap = {
"jquery": "jQuery",
"can-util/namespace": "can",
"kefir": "Kefir",
"validate.js": "validate",
"react": "React"
};
stealTools.export({
steal: {
config: __dirname + "/package.json!npm",
main: "can/all"
},
options: {
useNormalizedDependencies: false,
verbose: true
},
outputs: {
"all": {
modules: ["can/all"],
format: "global",
dest: globalJS.dest(__dirname+"/dist/global/can.all.js"),
useNormalizedDependencies: true,
normalize: function(depName, depLoad, curName, curLoad, loader){
return baseNormalize.call(this, depName, depLoad, curName, curLoad, loader, true);
},
ignore: ignoreModules,
exports: exportsMap,
removeDevelopmentCode: false
},
"core": {
modules: ["can/can"],
format: "global",
dest: globalJS.dest(__dirname+"/dist/global/can.js"),
useNormalizedDependencies: true,
normalize: function(depName, depLoad, curName, curLoad, loader){
return baseNormalize.call(this, depName, depLoad, curName, curLoad, loader, true);
},
ignore: ignoreModules,
exports: exportsMap,
removeDevelopmentCode: false
}
}
}).catch(function(e){
setTimeout(function(){
throw e;
},1);
});