python - How to serve clojurescript over flask -
i have small flask app , want use clojurescript enhance user experience on client-side.
now have trouble serving clojurescript via flask, paths mixed up.
flask asserts static files javascript scripts lie in directory static
. have changed project.clj
compile target put there:
:output-to "static/plot.js" :output-dir "static"
unfortunately, when loading file, cannot load dependent files goog.require
:
"clojurescript not load :main, did forget specify :asset-path?"
i believe missing leading /static
instead of static
in paths.
can specify prefix leiningen cljsbuild or clojurescript inlcudes?
you need specify :asset-path
in compiled options (as error message suggests). https://github.com/clojure/clojurescript/wiki/compiler-options#asset-path
when using :main necessary control entry point script attempts load scripts due configuration of web server. :asset-path relative url path not file system path.
:asset-path "assets/js"
Comments
Post a Comment