How do I organize my project structure and configure cljsbuild to require my own namespace? For example in my project/src-cljs
folder I have:
└── project
├── file1
│ └── file1.cljs
├── file2
│ └── file2.cljs
└─── required
└── required.cljs
I'd like file1.cljs
(namespaced as file1.file1
) and file2.cljs
(namespaced as file2.file2
) to require required.cljs
(namespaced as required.required
).
My :cljsbuild
looks like:
: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"}}]}
When I (:require [required.required :as required])
and compile I get the exception:
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