-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.profile.js
233 lines (206 loc) · 8.53 KB
/
build.profile.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
/**
* Based on the dojo-boilerplate
* https://github.com/csnover/dojo-boilerplate
* and https://github.com/tomwayson/esri-slurp-example
*
* Please refer to the Dojo Build tutorial for more details
* http://dojotoolkit.org/documentation/tutorials/1.10/build/
* Look to `util/build/buildControlDefault.js` for more information on available options and their default values.
*/
var profile = {
// `basePath` is relative to the directory containing this profile file; in this case, it is being set to the
// src/ directory, which is the same place as the `baseUrl` directory in the loader configuration.
basePath: './src',
// Builds a new release.
action: 'release',
// Strips all comments and whitespace from CSS files and inlines @imports where possible.
cssOptimize: 'comments',
// Excludes tests, demos, and original template files from being included in the built version.
mini: true,
// Uses Closure Compiler or "uglify" as the JavaScript minifier. This can also be set to "shrinksafe" to use ShrinkSafe,
// though ShrinkSafe is deprecated and not recommended.
// This option defaults to "" (no compression) if not provided.
optimize: 'closure',
// We're building layers, so we need to set the minifier to use for those, too.
// This defaults to "shrinksafe" if not provided.
layerOptimize: 'closure',
// remap cmv imports to their relative directory
map: {
'*': {
'viewer': 'cmv/viewer/js/viewer',
'gis': 'cmv/viewer/js/gis',
'proj4js': 'app/vendor'
}
},
// A list of packages that will be built. The same packages defined in the loader should be defined here in the
// build profile.
packages: [
// 'app' is a sample path for your application
// set this accordingly
'app',
'cmv',
'dijit',
'dojo',
'dojox', {
name: 'dstore',
location: 'dstore',
trees: [
// don't bother with .hidden, tests, min, src, and templates
['.', '.', /(\/\.)|(~$)|(test|txt|src|min|templates|build)/]
]
}, {
name: 'dgrid',
location: 'dgrid',
trees: [
// don't bother with .hidden, tests, min, src, and templates
['.', '.', /(\/\.)|(~$)|(test|txt|src|min|templates)/]
]
}, {
name: 'dgrid1',
location: 'dgrid1',
trees: [
// don't bother with .hidden, tests, min, src, and templates
['.', '.', /(\/\.)|(~$)|(test|txt|src|min|templates|demos)/]
]
}, {
name: 'xstyle',
location: 'xstyle',
trees: [
// don't bother with .hidden, tests, min, src, and templates
['.', '.', /(\/\.)|(~$)|(test|txt|src|min|templates)/]
]
}, {
name: 'put-selector',
location: 'put-selector',
trees: [
// don't bother with .hidden, tests, min, src, and templates
['.', '.', /(\/\.)|(~$)|(test|txt|src|min|templates)/]
]
},
'flag-icon-css',
'esri', {
name: 'moment',
location: 'moment',
main: 'moment',
trees: [
// don't bother with .hidden, tests, min, src, and templates
['.', '.', /(\/\.)|(~$)|(test|txt|src|min|templates)/]
],
resourceTags: {
amd: function (filename, mid) {
return (/\.js$/).test(filename);
}
}
}
],
// Build source map files to aid in debugging.
// This defaults to true.
useSourceMaps: false,
// If present and truthy, instructs the loader to consume the cache of layer member modules
noref: true,
// Strips all calls to console functions within the code. You can also set this to "warn" to strip everything
// but console.error, and any other truthy value to strip everything but console.warn and console.error.
// This defaults to "normal" (strip all but warn and error) if not provided.
stripConsole: 'normal', // if set to "all" will remove all console messages, include warnings and errors.
// The default selector engine is not included by default in a dojo.js build in order to make mobile builds
// smaller. We add it back here to avoid that extra HTTP request. There is also an "acme" selector available; if
// you use that, you will need to set the `selectorEngine` property in index.html, too.
selectorEngine: 'lite',
// Any module in an application can be converted into a "layer" module, which consists of the original module +
// additional dependencies built into the same file. Using layers allows applications to reduce the number of HTTP
// requests by combining all JavaScript into a single file.
layers: {
// This is the main loader module. It is a little special because it is treated like an AMD module even though
// it is actually just plain JavaScript. There is some extra magic in the build system specifically for this
// module ID.
'dojo/dojo': {
//put all styles in the build.css bundle
targetStylesheet: 'app/css/build.css',
// By default, the build system will try to include `dojo/main` in the built `dojo/dojo` layer, which adds
// a bunch of stuff we do not want or need. We want the initial script load to be as small and quick to
// load as possible, so we configure it as a custom, bootable base.
boot: true,
customBase: true,
include: [
// include the app, set accordingly for your application
'app/app',
'app/config/viewer',
// dependencies of esri/map that will be requested if not included
'dojox/gfx/path',
'dojox/gfx/svg',
'dojox/gfx/filters',
'dojox/gfx/svgext',
'dojox/gfx/shape',
'esri/dijit/Attribution',
'esri/layers/VectorTileLayerImpl',
//dgrid mobile
'dgrid/util/touch',
'dgrid/TouchScroll'
],
// You can define the locale for your application if you like
includeLocales: ['en-us']
}
},
// Providing hints to the build system allows code to be conditionally removed on a more granular level than simple
// module dependencies can allow. This is especially useful for creating tiny mobile builds. Keep in mind that dead
// code removal only happens in minifiers that support it! Currently, only Closure Compiler to the Dojo build system
// with dead code removal. A documented list of has-flags in use within the toolkit can be found at
// <http://dojotoolkit.org/reference-guide/dojo/has.html>.
staticHasFeatures: {
// The trace & log APIs are used for debugging the loader, so we do not need them in the build.
'dojo-trace-api': 0,
'dojo-log-api': 0,
// This causes normally private loader data to be exposed for debugging. In a release build, we do not need
// that either.
'dojo-publish-privates': 0,
// This application is pure AMD, so get rid of the legacy loader.
'dojo-sync-loader': 0,
// `dojo-xhr-factory` relies on `dojo-sync-loader`, which we have removed.
'dojo-xhr-factory': 0,
// We are not loading tests in production, so we can get rid of some test sniffing code.
'dojo-test-sniff': 0,
'extend-esri': 0,
'config-deferredInstrumentation': 0,
'config-dojo-loader-catches': 0,
'config-tlmSiblingOfDojo': 0,
'dojo-amd-factory-scan': 0,
'dojo-combo-api': 0,
'dojo-config-api': 1,
'dojo-config-require': 0,
'dojo-debug-messages': 0,
'dojo-dom-ready-api': 1,
'dojo-firebug': 0,
'dojo-guarantee-console': 1,
'dojo-has-api': 1,
'dojo-inject-api': 1,
'dojo-loader': 1,
'dojo-modulePaths': 0,
'dojo-moduleUrl': 0,
'dojo-requirejs-api': 0,
'dojo-sniff': 1,
'dojo-timeout-api': 0,
'dojo-undef-api': 0,
'dojo-v1x-i18n-Api': 1,
'dom': 1,
'host-browser': 1,
'extend-dojo': 1
},
defaultConfig: {
parseOnLoad: true,
deps: ['app/app'],
hasCache: {
'extend-esri': 0,
'dojo-has-api': 1,
'dojo-undef-api': 0
},
packages: [{
name: 'moment',
location: 'moment',
main: 'moment'
}]
},
//plugin required for building css
plugins: {
'xstyle/css': 'xstyle/build/amd-css'
}
};