Permalink
Browse files

Update sample README to show how to run in 'dev mode'.

  • Loading branch information...
1 parent 03be3eb commit 108e8959e6e777f5a43e843f7201852ee1d91621 @brentonashworth brentonashworth committed Jul 12, 2011
Showing with 30 additions and 12 deletions.
  1. +29 −11 samples/hello/README
  2. +1 −1 samples/hello/hello-dev.html
View
@@ -1,18 +1,36 @@
Simple ClojureScript Project Example.
-To run it...
+One-time Setup
+==============
-1) Make sure your clojurescript directory has the gclosure stuff in it and core.js.
-2) Add CLOJURESCRIPT_HOME environment variable.
-3) Add $CLOJURESCRIPT_HOME/bin to your PATH.
-3) Run
+- Create a CLOJURESCRIPT_HOME environment variable which points to the
+ ClojureScript root directory.
- cljsc src > hello.js
-
- or
+- If you have not already done so, execute
- cljsc src --compilation_level=ADVANCED_OPTIMIZATIONS > hello.js
+ $CLOJURESCRIPT_HOME/script/bootstrap
- in this directory.
-4) Open hello.html and enjoy!
+- Copy a Clojure 1.3 jar into $CLOJURESCRIPT_HOME/lib.
+
+- Add $CLOJURESCRIPT_HOME/bin to your PATH.
+
+Run in Development Mode
+=======================
+
+Development mode allows for each file to be loaded in a separate script tag so
+that errors can be easily tracked to the offending file.
+
+ cljsc src > hello.js
+
+After running the above command, open hello-dev.html. Notice that each required
+JavaScript file has been loaded in its most readable form.
+
+Run Optimized JavaScript
+========================
+
+Once an application is ready for production, a single optimized file can be produced.
+
+ cljsc src {:optimizations :advanced} > hello.js
+
+After running the above command, open hello.html to view the result.
@@ -5,7 +5,7 @@
<body>
<h1>Hello ClojureScript!</h1>
<!-- In unoptimized mode, additional script tags are required -->
- <script type="text/javascript" src="../../out/goog/base.js"></script>
+ <script type="text/javascript" src="out/goog/base.js"></script>
<script type="text/javascript" src="hello.js"></script>
<script>
goog.require('hello.core');

0 comments on commit 108e895

Please sign in to comment.