-
Notifications
You must be signed in to change notification settings - Fork 31
/
build.js
119 lines (117 loc) · 3.67 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
({
dir: '_build',
appDir: '.',
baseUrl: 'src',
mainConfigFile: 'src/main.js',
findNestedDependencies: true,
// doesn't handle plugin resources
removeCombined: true,
skipDirOptimize: true,
optimize: 'uglify2',
uglify2: {
output: {
'ascii_only': true
}
},
preserveLicenseComments: false,
// Separate CSS because relative URLs (images) within the CSS do not load
// properly in a production environment.
// https://github.com/guybedford/require-css/issues/139
separateCSS: true,
//optimizeCss: 'none',
inlineText: true,
stubModules: [
'text',
'tpl',
'json'
],
pragmasOnSave: {
excludeRequireCss: true,
excludeTpl: true
},
/**
* An attempt to solve the eternal optimization problem of how to bundle
* components and dependencies together so they will load the fastest for
* the most users, given variables such as
* - the overhead of an HTTP request
* - the browser cache
* - the rate of changes to files
*
* This is a configuration for the optimizer that's meaningless for the
* asynchronous loader, but we put it here because we generate the
* 'bundles' config that is used by the asynchronous loader from it, and
* it's not possible to represent all of this information using bundles.
*
* NOTE bundles.js may need to be updated if modules are changed
*/
modules: [
// begin buildmain.py delimiter
// Build-only dependencies that should be excluded from all built
// modules
{
create: true,
name: 'exclude',
include: [
'css/css',
'css/normalize',
'less/less',
'less/normalize'
]
},
// Global dependencies that may be already loaded on the page. If
// any aren't, then a single file containing them all will be
// requested once.
//
// If bootstrap is already loaded, and you load this bundle,
// you're going to have a bad time.
{
create: true,
name: 'global-deps',
include: [
'jquery',
'jquery.bootstrap',
'underscore'
],
exclude: [
'exclude'
]
},
// Local dependencies that don't change often, except for new ones being
// added.
{
create: true,
name: 'local-deps',
include: [
'jquery.jstree',
'jstree-actions',
'save-button',
'ckeditor',
'ckeditor-jquery',
// shim plugin dependencies don't automatically get included
// NOTE less! and css! cannot be combined in the same module
// https://github.com/guybedford/require-less/issues/48
'css/css!../node_modules/codemirror/lib/codemirror',
'css/css!../node_modules/jstree/dist/themes/default/style',
'css/css!../node_modules/at.js/dist/css/jquery.atwho'
],
exclude: [
'exclude',
'global-deps'
//'deferred-components'
]
},
// Everything else except main.
{
create: true,
name: 'main-components',
include: ['main'],
exclude: [
'exclude',
'global-deps',
//'deferred-components',
'local-deps'
]
}
// end buildmain.py delimiter
]
})