{ appDir: '..', baseUrl: 'js', mainConfigFile: '../js/config/require.js', dir: '../../../build_stage/settings', // Set the path to "empty" to prevent the scripts defining global objects // from being merged or they are removed after the optimization process, // which makes the objects inaccessible by reference. // If the inquiries to the object are all performed by requirejs, we can // remove the path of the object from the following list. // organized in alphabet order paths: { 'modules/defer': 'empty:', 'modules/dialog_panel': 'empty:', 'modules/navigator/mozApps': 'empty:', 'modules/wifi_context': 'empty:', 'modules/wifi_utils': 'empty:', 'prim': 'empty:', 'settings': 'empty:', 'shared/addons/match_pattern': 'empty:', 'shared/airplane_mode_helper': 'empty:', 'shared/apn_helper': 'empty:', 'shared/async_storage': 'empty:', 'shared/device_storage/enumerate_all': 'empty:', 'shared/homescreens/homescreen_settings': 'empty:', 'shared/icc_helper': 'empty:', 'shared/language_list': 'empty:', 'shared/lazy_loader': 'empty:', 'shared/manifest_helper': 'empty:', 'shared/mobile_operator': 'empty:', 'shared/omadrm/fl': 'empty:', 'shared/passcode_helper': 'empty:', 'shared/sanitizer': 'empty:', 'shared/settings_helper': 'empty:', 'shared/settings_listener': 'empty:', 'shared/settings_url': 'empty:', 'shared/simslot': 'empty:', 'shared/simslot_manager': 'empty:', 'shared/sim_settings_helper': 'empty:', 'shared/stk_helper': 'empty:', 'shared/toaster': 'empty:', 'shared/wifi_helper': 'empty:', 'shared/tz_select': 'empty:', 'vendor/jszip': 'empty:' }, findNestedDependencies: true, // Be sure to normalize all define() calls by extracting // dependencies so Function toString is not needed, and // lower capability devices like Tarako can optimize // memory by discarding function sources. This is // automatically done when an 'optimize' value other than // 'none' is used. This setting makes sure it happens for // builds where 'none' is used for 'optimize'. normalizeDirDefines: 'all', // optimize is now passed via Makefile's GAIA_SETTINGS_MINIFY // default is none if not passed at all. // optimize: 'none', // Just strip comments, no code compression or mangling. // Only active if optimize: 'uglify2' uglify2: { // Comment out the output section to get rid of line // returns and tabs spacing. output: { beautify: false }, compress: true, mangle: true }, // Rewrite the waitSeconds directive so that we never time out // waiting for modules to load when DEBUG=1 is not set. See // js/config/require.js for more details. onBuildWrite: function(id, url, contents) { if (id === 'config/require') { return contents.replace(/waitSeconds:\s*\d+/, 'waitSeconds: 0'); } else { return contents; } }, fileExclusionRegExp: /^\.|^test$|^build$/, // Keeping build dir since Makefile cleans it up and // preps build dir with the shared directory keepBuildDir: true, removeCombined: true }