OLD | NEW |
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. |
10 * | 10 * |
(...skipping 29 matching lines...) Expand all Loading... |
40 // are included in index.html separately as part of charm configuration, | 40 // are included in index.html separately as part of charm configuration, |
41 // and should not also be included in the minification. | 41 // and should not also be included in the minification. |
42 var paths = merge.readdir(syspath.join(process.cwd(), 'app'), | 42 var paths = merge.readdir(syspath.join(process.cwd(), 'app'), |
43 [syspath.join(process.cwd(), 'app/assets'), | 43 [syspath.join(process.cwd(), 'app/assets'), |
44 syspath.join(process.cwd(), 'app/modules-debug.js'), | 44 syspath.join(process.cwd(), 'app/modules-debug.js'), |
45 syspath.join(process.cwd(), 'app/config.js'), | 45 syspath.join(process.cwd(), 'app/config.js'), |
46 syspath.join(process.cwd(), 'app/config-debug.js')]); | 46 syspath.join(process.cwd(), 'app/config-debug.js')]); |
47 | 47 |
48 // templates.js is a generated file. It is not part of the app directory. | 48 // templates.js is a generated file. It is not part of the app directory. |
49 paths.push(syspath.join(process.cwd(), 'build/juju-ui/templates.js')); | 49 paths.push(syspath.join(process.cwd(), 'build/juju-ui/templates.js')); |
| 50 // XXX Why do we have to do this? (bug 1090563). |
| 51 paths.push(syspath.join(process.cwd(), 'app/models/charm.js')); |
50 | 52 |
51 merge.combineJs(paths, 'build/juju-ui/assets/app.js'); | 53 merge.combineJs(paths, 'build/juju-ui/assets/app.js'); |
52 | 54 |
53 // Get the paths to the YUI modules that we use. | 55 // Get the paths to the YUI modules that we use. |
54 var reqs = merge.loadRequires(paths); | 56 var reqs = merge.loadRequires(paths); |
55 | 57 |
56 // For some reason the loader does not get these requirements. | 58 // For some reason the loader does not get these requirements. |
57 // (Known issue #2) | 59 // (Known issue #2) |
58 reqs.push('lang/datatype-date-format_en-US'); | 60 reqs.push('lang/datatype-date-format_en-US'); |
59 reqs.push('parallel'); | 61 reqs.push('parallel'); |
(...skipping 13 matching lines...) Expand all Loading... |
73 'app/assets/javascripts/svg-layouts.js']); | 75 'app/assets/javascripts/svg-layouts.js']); |
74 | 76 |
75 merge.combineJs(filesToLoad.js, 'build/juju-ui/assets/all-yui.js'); | 77 merge.combineJs(filesToLoad.js, 'build/juju-ui/assets/all-yui.js'); |
76 | 78 |
77 var cssFiles = filesToLoad.css; | 79 var cssFiles = filesToLoad.css; |
78 cssFiles.push('app/assets/stylesheets/bootstrap-2.0.4.css'); | 80 cssFiles.push('app/assets/stylesheets/bootstrap-2.0.4.css'); |
79 cssFiles.push('app/assets/stylesheets/bootstrap-responsive-2.0.4.css'); | 81 cssFiles.push('app/assets/stylesheets/bootstrap-responsive-2.0.4.css'); |
80 merge.combineCSS(cssFiles, | 82 merge.combineCSS(cssFiles, |
81 'build/juju-ui/assets/combined-css/all-static.css'); | 83 'build/juju-ui/assets/combined-css/all-static.css'); |
82 }); | 84 }); |
OLD | NEW |