forked from oaeproject/3akai-ux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
178 lines (158 loc) · 7.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
/*
* This is an example build file that demonstrates how to use the build system for
* require.js.
*
* THIS BUILD FILE WILL NOT WORK. It is referencing paths that probably
* do not exist on your machine. Just use it as a guide.
*
*
*/
({
//The top level directory that contains your app. If this option is used
//then it assumed your scripts are in a subdirectory under this path.
//This option is not required. If it is not specified, then baseUrl
//below is the anchor point for finding things. If this option is specified,
//then all the files from the app directory will be copied to the dir:
//output area, and baseUrl will assume to be a relative path under
//this directory.
appDir: './',
//By default, all modules are located relative to this path. If baseUrl
//is not explicitly set, then all modules are loaded relative to
//the directory that holds the build file.
baseUrl: './dev/lib',
//Set paths for modules. If relative paths, set relative to baseUrl above.
//If you change these paths, please check out
//https://confluence.sakaiproject.org/x/sq_CB
paths: {
'jquery-plugins': 'jquery/plugins',
'jquery': 'jquery/jquery-1.7.2',
'jquery-ui': 'jquery/jquery-ui-1.8.20.custom',
'jquery-cookie': 'jquery/plugins/jquery.cookie',
'jquery-jstree': 'jquery/plugins/jsTree/jquery.jstree.sakai-edit',
'jquery-fileupload': 'jquery/plugins/jquery.fileupload',
'jquery-iframe-transport': 'jquery/plugins/jquery.iframe-transport',
'jquery-pager': 'jquery/plugins/jquery.pager.sakai-edited',
'jquery-tagcloud': 'jquery/plugins/jquery.tagcloud',
'underscore': 'misc/underscore',
'config': '../configuration'
},
//The directory path to save the output. If not specified, then
//the path will default to be a directory called 'build' as a sibling
//to the build file. All relative paths are relative to the build file.
dir: 'target/optimized',
//Used to inline i18n resources into the built file. If no locale
//is specified, i18n resources will not be inlined. Only one locale
//can be inlined for a build. Root bundles referenced by a build layer
//will be included in a build layer regardless of locale being set.
//locale: 'en-us',
//How to optimize all the JS files in the build output directory.
//Right now only the following values
//are supported (default is to not do any optimization):
//- 'closure': uses Google's Closure Compiler in simple optimization
//mode to minify the code.
//- 'closure.keepLines': Same as closure option, but keeps line returns
//in the minified files.
//- 'none': no minification will be done.
optimize: 'uglify',
//Allow CSS optimizations. Allowed values:
//- 'standard': @import inlining, comment removal and line returns.
//Removing line returns may have problems in IE, depending on the type
//of CSS.
//- 'standard.keepLines': like 'standard' but keeps line returns.
//- 'none': skip CSS optimizations.
optimizeCss: 'standard',
//If optimizeCss is in use, a list of of files to ignore for the @import
//inlining. The value of this option should be a comma separated list
//of CSS file names to ignore. The file names should match whatever
//strings are used in the @import calls.
cssImportIgnore: null,
//Inlines the text for any text! dependencies, to avoid the separate
//async XMLHttpRequest calls to load those dependencies.
inlineText: true,
//Allow 'use strict'; be included in the RequireJS files.
//Default is false because there are not many browsers that can properly
//process and give errors on code for ES5 strict mode,
//and there is a lot of legacy code that will not work in strict mode.
useStrict: false,
//Specify build pragmas. If the source files contain comments like so:
//>>excludeStart('fooExclude', pragmas.fooExclude);
//>>excludeEnd('fooExclude');
//Then the comments that start with //>> are the build pragmas.
//excludeStart/excludeEnd and includeStart/includeEnd work, and the
//the pragmas value to the includeStart or excludeStart lines
//is evaluated to see if the code between the Start and End pragma
//lines should be included or excluded.
pragmas: {
//Indicates require will be included with jquery.
//jquery: true
},
//Skip processing for pragmas.
skipPragmas: false,
//If skipModuleInsertion is false, then files that do not use require.def
//to define modules will get a require.def() placeholder inserted for them.
//Also, require.pause/resume calls will be inserted.
//Set it to true to avoid this. This is useful if you are building code that
//does not use require() in the built project or in the JS files, but you
//still want to use the optimization tool from RequireJS to concatenate modules
//together.
skipModuleInsertion: false,
//List the modules that will be optimized. All their immediate and deep
//dependencies will be included in the module's file when the build is
//done. If that module or any of its dependencies includes i18n bundles,
//only the root bundles will be included unless the locale: section is set above.
modules: [
{
name: 'sakai/sakai.dependencies'
}
//Just specifying a module name means that module will be converted into
//a built file that contains all of its dependencies. If that module or any
//of its dependencies includes i18n bundles, they may not be included in the
//built file unless the locale: section is set above.
//{
//name: 'foo/bar/bop',
//Should the contents of require.js be included in the optimized module.
//Defaults to false.
//includeRequire: true,
//For build profiles that contain more than one modules entry,
//allow overrides for the properties that set for the whole build,
//for example a different set of pragmas for this module.
//The override's value is an object that can
//contain any of the other build options in this file.
//override: {
// pragmas: {
// fooExclude: true
// }
//}
//},
//This module entry combines all the dependencies of foo/bar/bop and foo/bar/bee
//and any of their dependencies into one file.
//{
// name: 'foo/bar/bop',
// include: ['foo/bar/bee']
//},
//This module entry combines all the dependencies of foo/bar/bip into one file,
//but excludes foo/bar/bop and its dependencies from the built file. If you want
//to exclude a module that is also another module being optimized, it is more
//efficient if you define that module optimization entry before using it
//in an exclude array.
//{
// name: 'foo/bar/bip',
// exclude: [
// 'foo/bar/bop'
// ]
//},
//This module entry shows how to specify a specific module be excluded
//from the built module file. excludeShallow means just exclude that
//specific module, but if that module has nested dependencies that are
//part of the built file, keep them in there. This is useful during
//development when you want to have a fast bundled set of modules, but
//just develop/debug one or two modules at a time.
//{
// name: 'foo/bar/bin',
// excludeShallow: [
// 'foo/bar/bot'
// ]
//}
],
dirExclusionRegExp: /^(\.|tools|target|test)/
})