From 77fb997785daf7510fe50a5b79c3fa0a0ae85eea Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Thu, 22 Sep 2016 10:38:45 -0700 Subject: [PATCH] Fix source paths. --- README.md | 18 ++++++++++++++++++ project.clj | 19 +++++++++++++------ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d9db9546..77f90f5a 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,24 @@ brew install rlwrap Run `lein cljsbuild auto advanced` to generate JavaScript into `target/`. +To build for a browser, into `release-browser`: + +``` +lein cljsbuild once release-browser +``` + +To build for node, into `release-node`: + +``` +lein cljsbuild once release-node +``` + +To package or install a JAR for node, modifying the source path appropriately (make sure you clean up swap or temp files in `src`!): + +``` +lein with-profile node jar +``` + ### Starting a ClojureScript REPL from the terminal ``` diff --git a/project.clj b/project.clj index bf0b92a6..07fdaa65 100644 --- a/project.clj +++ b/project.clj @@ -12,13 +12,19 @@ [jamesmacaulay/cljs-promises "0.1.0"]] ;; The browser will never require from the .JAR anyway. - :source-paths ["src/common" "src/node"] + :source-paths [ + "src/common" + ;; Can't be enabled by default: layers on top of cljsbuild! + ;; Instead, add the :node profile: + ;; lein with-profile node install + ;"src/node" + ] :cljsbuild {:builds { :release-node { - :source-paths ["src/node" "src/common"] + :source-paths ["src/node"] :assert false :compiler { @@ -46,7 +52,7 @@ ;; There's no point in generating a source map -- it'll be wrong ;; due to wrapping. { - :source-paths ["src/browser" "src/common"] + :source-paths ["src/common" "src/browser"] :assert false :compiler { @@ -67,7 +73,7 @@ :notify-command ["release-browser/wrap_bare.sh"]} :advanced - {:source-paths ["src/node" "src/common"] + {:source-paths ["src/node"] :compiler { :language-in :ecmascript5 @@ -83,7 +89,7 @@ :test { - :source-paths ["src/node" "src/common" "test"] + :source-paths ["src/node" "test"] :compiler { :language-in :ecmascript5 @@ -98,7 +104,8 @@ }} }} - :profiles {:dev {:dependencies [[cljsbuild "1.1.3"] + :profiles {:node {:source-paths ["src/common" "src/node"]} + :dev {:dependencies [[cljsbuild "1.1.3"] [tempfile "0.2.0"] [com.cemerick/piggieback "0.2.1"] [org.clojure/tools.nrepl "0.2.10"]