我一直在命令行中尝试下面的操作,以使ClojureScript运行$ lein cljsbuild auto。但是不断收到一个无法找到交叉的警告: web-viz.x-over。交叉线在下面的项目中。
(defproject web-viz
:dependencies [[org.clojure/clojure "1.4.0"]
[ring/ring-core "1.1.7"]
[ring/ring-jetty-adapter "1.1.7"]
[compojure "1.1.3"]
[hiccup "1.0.2"]]
:plugins [[lein-ring "0.8.3"]
[lein-cljsbuild "0.2.10"]]
:ring {:handler web-viz.web/app}
:cljsbuild {:crossovers [web-viz.x-over],
:builds [{:source-paths ["src-cljs"],
:crossover-path "xover-cljs",
:compiler
{:pretty-print true,
:output-to "resources/js/script.js",
:optimizations :whitespace}}]})最后,我试图启动并看到这一点:

已编制了下列目录:
$ mkdir -p src-cljs/webviz
$ mkdir -p resources/js下面的文件还创建了包含以下内容的src-cljs/webviz/core.cljs
(ns webviz.core)
(defn ^:export hello [world]
(js/alert (str "Hello, " world)))我的web.clj包含
(defn index-page []
(html5
[:head
[:title "Web Charts"]]
[:body
[:h1 {:id "web-charts"} "Web Charts"]
[:ol
[:li [:a {:href "/data/census-race.json"} "2010 Census Race Data"]]]
(include-js "js/script.js")
(javascript-tag "webviz.core.hello('from ClojureScript!');")]))
(defroutes site-routes
(GET "/" [] (index-page))
(route/resources "/")
(route/not-found "Page not found"))
(def app (-> (handler/site site-routes)))发布于 2014-04-11 22:23:17
您正在使用一个非常过时的教程。根据莱宁根博士的说法,交叉符是不推荐的。此外,只有当您打算在后端/前端之间共享代码时,您才需要它们,我对此表示怀疑。
据我所知,ClojureScript项目最简单的起点是:
$ lein new mies webviz && cd webviz
$ lein cljsbuild once
$ open index.html这将给你一个空白的页面,和一个“你好世界!”在javascript控制台中。
https://stackoverflow.com/questions/22898495
复制相似问题