-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.js
54 lines (48 loc) · 1.44 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
var buildCordova = process.argv.indexOf("cordova") > 0;
var buildElectron = process.argv.indexOf("electron") > 0;
const stealTools = require("steal-tools");
let buildPromise = stealTools.build({
map: ((buildElectron || buildCordova) ? {
"can-route-pushstate": "can-route-hash"
} : {})
}, {
bundleAssets: true
});
// options added by `donejs add cordova` - START
var cordovaOptions = {
buildDir: "./build/cordova",
id: "com.donejs.donejschat",
name: "donejs chat",
platforms: ["ios"],
plugins: ["cordova-plugin-transport-security"],
index: __dirname + "/production.html",
glob: []
};
var stealCordova = require("steal-cordova")(cordovaOptions);
// Check if the cordova option is passed.
var buildCordova = process.argv.indexOf("cordova") > 0;
if(buildCordova) {
buildPromise.then(stealCordova.build).then(stealCordova.ios.emulate);
}
// options added by `donejs add cordova` - END
// options added by `donejs add electron` - START
var electronOptions = {
main: "electron-main.js",
buildDir: "./build",
platforms: ["darwin"],
archs: ["x64"],
glob: [
"package.json",
"production.html",
"node_modules/steal/steal.production.js"
]
};
var stealElectron = require("steal-electron");
if(buildElectron) {
buildPromise = buildPromise.then(function(buildResult){
return stealElectron(electronOptions, buildResult);
}).catch(function(err) {
console.log(err);
});
}
// options added by `donejs add electron` - END