gpt4 book ai didi

clojure - "' cljsbuild ' not a task"

转载 作者:行者123 更新时间:2023-12-02 12:03:59 25 4
gpt4 key购买 nike

使用 lein for clojure,尝试使用 clojurescript 插件。遵循所有 readme.md 安装步骤,project.clj 已

  :dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "0.0-3126"]]
;; lein-cljsbuild plugin to build a CLJS project
:plugins [[lein-cljsbuild "1.0.6"]]
:hooks [leiningen.cljsbuild]

我似乎无法让 lein 识别该插件,并且不确定 gremlin 是什么。

C:\Functional_Languages\Clojure\clojurescript_master\!work\modern-cljs>lein cljsbuild once
'cljsbuild' is not a task. See 'lein help'.
C:\Functional_Languages\Clojure\clojurescript_master\!work\modern-cljs>lein compile
C:\Functional_Languages\Clojure\clojurescript_master\!work\modern-cljs>lein cljsbuild once
'cljsbuild' is not a task. See 'lein help'.
C:\Functional_Languages\Clojure\clojurescript_master\!work\modern-cljs>lein -v
Leiningen 2.5.1 on Java 1.8.0_51 Java HotSpot(TM) 64-Bit Server VM
C:\Functional_Languages\Clojure\clojurescript_master\!work\modern-cljs>

最佳答案

如果使用lein new mies ...获取项目文件,并执行命令,自动生成的project.clj文件应该被修改。这是显示更改的示例:

之前:

(defproject simple "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.122" :classifier "aot"
:exclusion [org.clojure/data.json]]
[org.clojure/data.json "0.2.6" :classifier "aot"]]
:jvm-opts ^:replace ["-Xmx1g" "-server"]
:plugins [[lein-npm "0.6.1"]]
:npm {:dependencies [[source-map-support "0.3.2"]]}
:source-paths ["src" "target/classes"]
:clean-targets ["out" "release"]
:target-path "target")

之后

(defproject simple "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.122" :classifier "aot"
:exclusion [org.clojure/data.json]]
[org.clojure/data.json "0.2.6" :classifier "aot"]]

:node-dependencies [[source-map-support "0.2.8"]]

:jvm-opts ^:replace ["-Xmx1g" "-server"]

:plugins [[lein-npm "0.6.1"]
[lein-cljsbuild "1.0.4"]]

:npm {:dependencies [[source-map-support "0.3.2"]]}
:source-paths ["src" "target/classes"]
:clean-targets ["out" "release"]
:target-path "target"

:cljsbuild {
:builds [{:id "simple"
:source-paths ["src"]
:compiler {
:main simple.core
:output-to "out/simple.js"
:output-dir "out"
:optimizations :none
:target :nodejs
:cache-analysis true
:source-map true}}]})

如您所见,您需要添加带有构建信息的 lein-cljsbuild 插件。进一步解释请引用http://www.mase.io/code/clojure/node/2015/01/24/getting-started-with-clojurecript-and-node/

如果您不想进行更改,只需运行./scripts/build

关于clojure - "' cljsbuild ' not a task",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31508085/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com