forked from CesiumGS/cesium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCesium.build.js
33 lines (28 loc) · 1.07 KB
/
Cesium.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
/*global require,process*/
//replace the version of UglifyJS that the r.js optimizer uses with a newer one with far better performance
//adapted from https://github.com/jrburke/r.js/blob/master/build/tests/override/override.js
var uglify = require('./Tools/uglify-js'),
requirejs = require('./Tools/r.js');
//Register the replacement module. Note that for uglifyjs, r.js uses the
//"uglifyjs/index" module name for it. The list of replaceable modules
//can be found in r.js/
requirejs.define('uglifyjs/index', [], function () {
return uglify;
});
var optimize = process.argv[2];
//Do the build.
requirejs.optimize({
baseUrl : ".",
name: "../ThirdParty/almond.js",
include: "main",
out: "../Build/Cesium.js",
wrap: true,
optimize: optimize ? "uglify" : "none",
//Usually requirejs.optimize() runs in "silent mode"
//when called in this way. Use logLevel to get the
//normal output out.
logLevel: 0
}, function () {
//Do not really care about the build output summary,
//since the logLevel: 0 will show it anyway in the console.
});