Fork me on GitHub
#luminus
<
2016-12-26
>
puzzler02:12:31

@ts1503 Open a second command prompt and type "lein figwheel" to start the Clojurescript compiler. Then reload the page.

ts150305:12:44

thanks @puzzler but figwheel it is development tool. I dont want run him on production server

yogthos06:12:05

@ts1503 looks like there's a bug in the +cljs profile

puzzler06:12:48

@ts1503 If the profile doesn't automatically run "lein cljsbuild once name-of-production-profile" before building the uberjar, you may be able to manually run that step to produce the js file, and then hopefully the uberjar will pick it up.

yogthos06:12:00

it should be doing that actually, there's a prep task :prep-tasks ["compile" ["cljsbuild" "once" "min"]] I see the following lines when running lein uberjar:

Compiling "target/cljsbuild/public/js/app.js" from ["src/cljc" "src/cljs" "env/prod/cljs"]...
Successfully compiled "target/cljsbuild/public/js/app.js" in 14.505 seconds.

yogthos06:12:13

and there is a js file that's readable when the server runs

yogthos06:12:51

this also appears to work correctly in +reagent and +re-frame profiles, not sure what's different in the +cljs one

ts150307:12:36

cljsbuild compile file successfuly. But generated app.js file didnt contain script from core.cljs file

yogthos07:12:08

it looks like it does

yogthos07:12:30

it's just that the init! function isn't replacing the content of the div

yogthos07:12:13

changing the init! function as follows seems to do the trick:

(defn init! []
  (let [body (js/document.createElement "body")]
    (.appendChild body (js/document.createTextNode "Welcome to myapp"))
    (set! (.-body js/document) body)))

yogthos07:12:15

just pushed out a new template to clojars with the fix

ts150308:12:29

now its works! thanks