【发布时间】:2015-10-31 00:11:11
【问题描述】:
如何组织我的项目结构并将 cljsbuild 配置为需要我自己的命名空间?例如在我的project/src-cljs 文件夹中:
└── project
├── file1
│ └── file1.cljs
├── file2
│ └── file2.cljs
└─── required
└── required.cljs
我希望file1.cljs(命名空间为file1.file1)和file2.cljs(命名空间为file2.file2)要求required.cljs(命名空间为required.required)。
我的:cljsbuild 看起来像:
:cljsbuild {:builds
[{:source-paths ["src-cljs/project/file1"]
:compiler {:output-to "resources/public/js/file1.js"}}
{:source-paths ["src-cljs/project/file2"]
:compiler {:output-to "resources/public/js/file2.js"}}]}
当我 (:require [required.required :as required]) 并编译时,我得到了异常:
Caused by: clojure.lang.ExceptionInfo: No such namespace: required.required, could not locate required/required.cljs, required/required.cljc, or Closure namespace "required.required" at line 1 src-cljs/project/file1/file1.cljs
【问题讨论】:
标签: compilation leiningen clojurescript cljsbuild