【问题标题】:Clojure to JavaScript Converter (Leiningen)Clojure 到 JavaScript 转换器 (Leiningen)
【发布时间】:2013-11-27 09:39:46
【问题描述】:

我已经安装了 Leiningen 并设置了项目。有人告诉我使用“lein cljsbuild once”命令将 Clojure 转换为 JavaScript。这没有完全回答我的问题,因为我无法理解项目的文件夹结构。

这是我的项目.clj:

    (defproject proj "2.3.4"
  :plugins [[lein-cljsbuild "1.0.1-SNAPSHOT"]]
  :cljsbuild {
    :builds [{
        ; The path to the top-level ClojureScript source directory:
        :source-paths ["src"]
        ; The standard ClojureScript compiler options:
        ; (See the ClojureScript compiler documentation for details.)
        :dependencies [[org.clojure/clojure "1.5.1"]]
        :main project.clj
        :compiler {
          :optimizations :whitespace
          :pretty-print true}}]})

我理解它的方式是它会自动检测在“src”文件夹中找到的文件并将它们输出到 target/clojurescript-main.js(或类似的东西)。我将要转换的文件放入 src 文件夹,它似乎编译了一些东西。当我检查目标文件夹时,它包含在 project.clj 中设置的文件,但它不包含我期望的 JavaScript 代码(我看到的只是 goog. 与我要转换的文件无关的方法)。

我的问题是:正确的文件夹结构是什么?我是否必须将我的源路径设置为例如“src/filename.clj”?

提前致谢

【问题讨论】:

    标签: javascript compiler-construction clojure leiningen clojurescript


    【解决方案1】:

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-01-01
    • 2011-07-22
    • 2011-01-23
    • 2013-09-22
    • 2012-07-07
    • 1970-01-01
    • 1970-01-01
    • 2014-10-17
    相关资源
    最近更新 更多