forked from donejs/place-my-order
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
50 lines (44 loc) · 1.19 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
var stealTools = require("steal-tools");
var buildPromise = stealTools.build({
config: __dirname + "/package.json!npm"
}, {
bundleAssets: {
infer: false,
glob: "node_modules/place-my-order-assets/images/**/*"
}
});
var cordovaOptions = {
buildDir: "./build/cordova",
id: "com.donejs.placemyorder",
name: "place-my-order",
platforms: ["ios"],
plugins: ["cordova-plugin-transport-security"],
index: __dirname + "/production.html",
glob: [
"node_modules/steal/steal.production.js"
]
};
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);
}
var nwOptions = {
buildDir: "./build",
version: "0.12.3",
platforms: ["osx32","osx64"],
files: [
"package.json",
"production.html",
"node_modules/steal/steal.production.js"
]
};
var stealNw = require("steal-nw");
// Check if the cordova option is passed.
var buildNW = process.argv.indexOf("nw") > 0;
if(buildNW) {
buildPromise = buildPromise.then(function(buildResult){
stealNw(nwOptions, buildResult);
});
}