Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 #!/usr/bin/env node | 1 #!/usr/bin/env node |
2 | 2 |
3 /* | 3 /* |
4 * We aggregate and minimize the JavaScript sources in order to improve the | 4 * We aggregate and minimize the JavaScript sources in order to improve the |
5 * load speed of the application. | 5 * load speed of the application. |
6 * | 6 * |
7 * We don't want to use the YUI combo loader feature because we want to be able | 7 * We don't want to use the YUI combo loader feature because we want to be able |
8 * to run from only static files and we want to be able to run behind a | 8 * to run from only static files and we want to be able to run behind a |
9 * firewall without access to the internet. | 9 * firewall without access to the internet. |
bac
2012/12/04 14:50:11
Can we do this now? Are we not getting anything f
benji
2012/12/04 17:22:23
If "this" is "use the YUI combo loader", then no.
| |
10 * | 10 * |
11 * The final product will provide three JavaScript files: one for the YUI | 11 * The final product will provide three JavaScript files: one for the YUI |
12 * dependencies, one for our custom JavaScript code and one for third party | 12 * dependencies, one for our custom JavaScript code and one for third party |
13 * JavaScript like D3. | 13 * JavaScript like D3. |
14 * | 14 * |
15 * Known issues: | 15 * Known issues: |
16 * (1) If we set "bootstrap=false" in the GlobalConfig object, YUI disables the | 16 * (1) If we set "bootstrap=false" in the GlobalConfig object, YUI disables the |
17 * loader object. It means it wont even try to download modules. We cannot | 17 * loader object. It means it will not even try to download modules. We |
bac
2012/12/04 14:50:11
typo: won't
benji
2012/12/04 17:22:23
Thanks, I didn't see that typo when I was editing
| |
18 * do it because the loader also manages the "use" property which defines | 18 * cannot do it because the loader also manages the "use" property which |
bac
2012/12/04 14:50:11
"We cannot do it" -- what is "it"? I cannot parse
benji
2012/12/04 17:22:23
I don't know. I didn't write this text, I was jus
| |
19 * aliases for some of your modules ('juju-views' and 'juju-controllers'). | 19 * defines aliases for some of your modules ('juju-views' and |
20 * 'juju-controllers'). | |
20 * (2) During development, we've noticed that some of the YUI modules weren't | 21 * (2) During development, we've noticed that some of the YUI modules weren't |
21 * included in the list of YUI files (lang/datatype-date-format_en-US, | 22 * included in the list of YUI files (lang/datatype-date-format_en-US, |
22 * parallel, app-transitions-native, gallery-markdown, loader-base). For | 23 * parallel, app-transitions-native, gallery-markdown, loader-base). For |
23 * some reason, the loader does not resolve the names of the files for | 24 * some reason, the loader does not resolve the names of the files for |
24 * these modules. We need to add them manually in this file. | 25 * these modules. We need to add them manually in this file. |
25 */ | 26 */ |
26 | 27 |
27 'use strict'; | 28 'use strict'; |
28 | 29 |
29 require('yui').YUI().use(['yui'], function(Y) { | 30 require('yui').YUI().use(['yui'], function(Y) { |
(...skipping 29 matching lines...) Expand all Loading... | |
59 // Get all of the YUI files and their dependencies | 60 // Get all of the YUI files and their dependencies |
60 var filesToLoad = merge.getYUIFiles(reqs); | 61 var filesToLoad = merge.getYUIFiles(reqs); |
61 | 62 |
62 // Merge third-party files to the filesToLoad list | 63 // Merge third-party files to the filesToLoad list |
63 filesToLoad.js.push.apply(filesToLoad.js, [ | 64 filesToLoad.js.push.apply(filesToLoad.js, [ |
64 'app/assets/javascripts/d3.v2.min.js', | 65 'app/assets/javascripts/d3.v2.min.js', |
65 'app/assets/javascripts/d3-components.js', | 66 'app/assets/javascripts/d3-components.js', |
66 'app/assets/javascripts/reconnecting-websocket.js', | 67 'app/assets/javascripts/reconnecting-websocket.js', |
67 'app/assets/javascripts/svg-layouts.js' ]); | 68 'app/assets/javascripts/svg-layouts.js' ]); |
68 ·· | 69 ·· |
69 merge.combineJs(filesToLoad.js, | 70 merge.combineJs(filesToLoad.js, 'build/juju-ui/assets/all-yui.js'); |
70 'build/juju-ui/assets/all-yui.js', 'uglifyjs'); | |
71 | 71 |
72 var cssFiles = filesToLoad.css; | 72 var cssFiles = filesToLoad.css; |
73 cssFiles.push('app/assets/stylesheets/bootstrap-2.0.4.css'); | 73 cssFiles.push('app/assets/stylesheets/bootstrap-2.0.4.css'); |
74 cssFiles.push('app/assets/stylesheets/bootstrap-responsive-2.0.4.css'); | 74 cssFiles.push('app/assets/stylesheets/bootstrap-responsive-2.0.4.css'); |
75 merge.combineCSS(cssFiles, | 75 merge.combineCSS(cssFiles, |
76 'build/', | 76 'build/juju-ui/assets/combined-css/all-static.css'); |
77 'build/juju-ui/assets/combined-css/all-static.css', 'yui-css'); | |
78 }); | 77 }); |
LEFT | RIGHT |