-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
50 lines (40 loc) · 1.37 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
// r.js build configuration file
// (avaiable options: http://bit.ly/rCF5v5)
({
baseUrl: './lib',
// define paths for vendor dependencies
paths: {
// we use a jQuery adapter because we don't want
// to include jQuery in the build
jquery: '../support/jquery-adapter',
underscore: '../vendor/underscore-1.3.1',
backbone: '../vendor/backbone-0.9.2'
},
// use almond, a require.js shim, to allow usage
// of ginseng without require.js
name: '../vendor/almond',
// optimize the output with uglify.js
optimize: 'none',
preserveLicenseComments: true,
// only include ginseng.js because it holds
// all the references
include: ['ginseng'],
// wrap build into a module and export ginseng either as AMD module
// or, if no AMD loader is available, as global
wrap: {
start: "(function(global) {",
end: " var Ginseng = require('ginseng');" +
" if(global.define) {" +
// define ginseng as AMD module with global AMD loader
" (function(define) {" +
" define(function() { return Ginseng; });" +
" }(global.define));" +
" } else {" +
// define ginseng in the global namespace
" global['Ginseng'] = Ginseng;" +
" };" +
"}(this));"
},
// save build in the following file
out: './build/ginseng.js'
})