Permalink
Browse files

more cleanup on js/ files, now with a bundle there as well. 11 script…

… tags on main.html, down from 41...
  • Loading branch information...
1 parent 8b1c9da commit 66ce220077c71e06892adcc10b01f0bf8f0fe5c3 cscheid@research.att.com committed Jun 20, 2012
Showing with 2,535 additions and 22 deletions.
  1. +1 −0 .hgignore
  2. +10 −0 doc/README
  3. +33 −0 js/Makefile
  4. +2,488 −0 js/rcloud_bundle.js
  5. +1 −0 js/rcloud_bundle.min.js
  6. +1 −11 main.html
  7. +1 −11 share.html
View
@@ -5,3 +5,4 @@ pids.txt
tmp
userfiles
lib/node_modules
+js/node_modules
View
@@ -0,0 +1,10 @@
+# Building
+
+The javascript files required by RCloud are now bundled together to
+reduce bugs (``I forgot to add the new .js file again'') and to reduce
+the number of HTTP requests.
+
+This means that you will have to recompile the bundles every time the
+javascript has changed. Currently the HTML sources are using the
+un-minified javascript, so all that is needed is to go into js/ and
+type make.
View
@@ -0,0 +1,33 @@
+JS_COMPILER = ./node_modules/uglify-js/bin/uglifyjs
+
+all: rcloud_bundle.js rcloud_bundle.min.js
+
+rcloud_bundle.js: \
+ plot.js \
+ chart.js \
+ facet_chart.js \
+ websockets.js \
+ rclient.js \
+ buffer.js \
+ parse.js \
+ peg_parser.js \
+ objs.js \
+ Rsrv.js \
+ rcloud.js
+
+rcloud_bundle.min.js: rcloud_bundle.js Makefile
+ @rm -f $@
+ $(JS_COMPILER) < $< > $@
+ chmod -w $@
+
+rcloud_bundle.js: Makefile
+ echo $^
+ @rm -f $@
+ cat $(filter %.js,$^) > $@
+ifeq ($(CHECK),1)
+ jshint $(filter %.js,$(filter-out lib/%.js,$(filter-out %/_begin.js,$(filter-out %/_end.js, $^))))
+endif
+ chmod -w $@
+
+clean:
+ rm -f rcloud_bundle.js rcloud_bundle.min.js
Oops, something went wrong.

0 comments on commit 66ce220

Please sign in to comment.