-
-
Notifications
You must be signed in to change notification settings - Fork 147
Create a Klipse compatible js bundle for a Clojurescript library
Yehonathan Sharvit edited this page Sep 4, 2020
·
2 revisions
I want to use a ClojureScript library called my-lib
inside Klipse.
But my-lib
is not self hosted compatible.
Compile my-lib
as a JavaScript bundle file named <my_lib_bundle>.js
and include the Javascript file in the page where you run Klipse.
When we compile my-lib
as a JavaScript bundle, we need to omit namespaces that are already contained in Klipse (e.g cljs.core
, clojure.set
etc...).
The simplest way to generate a bundle from my-lib
without the common namespaces with Klipse is to use the modules flag of the ClojureScript compiler.
Here is the process:
- Add this file under your
src
folder and call itklipse_bundle.cljs
- Add this build file to your library.
- Change the content of the file with the name of your library and the name of the main namespaces of your library.
- Run this command
clj --main cljs.main --compile-opts build-for-klipse.edn --compile klipse-bundle