-
Notifications
You must be signed in to change notification settings - Fork 99
[Help] Tweaking the template to work with nodejs repl #222
Comments
I've tweaked the {:id "nodejs"
:source-paths ["src/cljs" "src/cljc" "dev"]
:compiler {:main cljs.user
:target :nodejs
:asset-path "js/compiled/out"
:output-to "resources/public/js/compiled/nodejs/nodejs.js"
:output-dir "resources/public/js/compiled/nodejs"
:source-map-timestamp true}} |
I've started to work on a seperate branch with I've made progress with the configuration here {:id "nodejs"
:source-paths ["src/nodejs" "src/cljc" ]
:compiler {:main cljs.user
:target :nodejs
;:asset-path "js/compiled/out"
:output-to "resources/public/js/compiled/nodejs/nodejs.js"
:output-dir "resources/public/js/compiled/nodejs"
:pretty-print true
:optimizations :simple
;:optimizations :advanced :simple :whitespace :none
:parallel-build true
:npm-deps {"chalk" "2.1.0"}
:install-deps true
;:source-map-timestamp true
;:source-map true
:warnings false}} And the code in (ns devnagri-ui-tests.nodejs
(:require [clojure.string :as str]
[cljs.nodejs :as nodejs]))
(nodejs/enable-util-print!)
(defn -main [& args]
(-> (str/join " " args)
(str/replace #"cker\b" "xor")
(str/replace #"e|E" "3")
(str/replace #"i|I" "1")
(str/replace #"o|O" "0")
(str/replace #"s|S" "5")
(str/replace #"a|A" "4")
(str/replace #"t|T" "7")
(str/replace #"b|B" "6")
(str/replace #"c|C" "(")
println))
(set! *main-cli-fn* -main) But running the ❯ npm test
> devnagri-ui-tests@1.0.0 test /Users/eklavya/Projects/ProjectEklavya/BlueCollar/devnagri-ui-tests
> /Users/eklavya/.nvm/versions/node/v8.1.3/bin/node resources/public/js/compiled/nodejs/nodejs.js
The expected output is as follows $ l33t I am a leet hacker
1 4m 4 l337 h4x0r This is taken from blog-post by plexus here https://lambdaisland.com/blog/02-05-2017-nodejs-scripts-clojurescript |
Hey there! The one issue I was running into with your code specifically was that your version of clojurescript didn't seem to like compiling node. The following worked: Your cljs main should probably also be
In the future, this kind of thing would be ideal to bring up in the mailing list or on the clojurian slack, not as an issue here. |
Hi guys,
I've been trying to get
chestnut
working with anodejs-repl
instead of abrowser-repl
but I'm lost in the configurations ofcljsbuild
. Could you help me achieve this ?The text was updated successfully, but these errors were encountered: