Questions tagged [cljsbuild]

Leiningen plugin to make ClojureScript development easy.

lein-cljsbuild

This is a Leiningen plugin that makes it quick and easy to automatically compile your ClojureScript code into Javascript whenever you modify it. It's simple to install and allows you to configure the ClojureScript compiler from within your project.clj file.

Beyond basic compiler support, lein-cljsbuild can optionally help with a few other things:

The latest version of lein-cljsbuild is 1.1.7. See the release notes here.

39 questions
6
votes
6 answers

Clojurescript libraries - goog.require could not find

New to clojurescript, and working through the "Modern CLJS" tutorial here. It instructs to pull in domina by adding it to the project.clj: :dependencies [[org.clojure/clojure "1.4.0"] [compojure "1.1.5"] [domina…
BnWasteland
  • 2,109
  • 1
  • 18
  • 14
5
votes
1 answer

lein figwheel vs lein cljsbuild auto

What is the difference between lein figwheel and lein cljsbuild auto because I believe that they are both used to compile clojurescript. Also is there any benefit to using one over the other?
rbb
  • 989
  • 6
  • 19
5
votes
3 answers

ClojureScript's separate builds for multipage web app

I have a web app that uses Clojure on backend and ClojureScript on frontend, and it consists of several pages, each requiring appropriate builded js file. Now I know that cljsbuild can build separate builds (if specified in :builds section of…
Twice_Twice
  • 527
  • 4
  • 16
5
votes
2 answers

Auto building Clojurescript files for Compojure app

I have a web application where i'm using Compojure on the server and Clojurescript on the client. I'm using the leing-cljsbuild plugin to automatically compile cljs files to js. I'm able to generate the required client side files and load them in…
jack the lesser
  • 701
  • 2
  • 7
  • 15
5
votes
1 answer

Compiling external JS files with Cljsbuild in ClojureScript

I'm trying to compile some JS libraries that we have with lein-cljsbuild to integrate them in our ClojureScript code base. First I added some goog.provide in top of each file, and the files are hierarchically organised in a directory tree according…
z1naOK9nu8iY5A
  • 903
  • 7
  • 22
4
votes
1 answer

How do I avoid duplication in a cljsbuild project?

The :cljsbuild section of my project.clj has a lot of duplication: :cljsbuild { :builds {:dev {:source-paths ["src-cljs"] :compiler {:output-dir "resources/public/js" :output-to…
Paul Butcher
  • 10,722
  • 3
  • 40
  • 44
4
votes
2 answers

Multiple ClojureScript files on same page

I have a project that is using Jasmine to test the JavaScript. I am trying to switch to using ClojureScript for the front end. My project.clj is like (defproject myproject "0.1.0-SNAPSHOT" :dependencies [[org.clojure/clojure "1.5.1"] …
robertjlooby
  • 7,160
  • 2
  • 33
  • 45
4
votes
3 answers

lein-cljsbuild source-cljs dir -> output-js dir?

Looking at cljsbuild doc https://github.com/emezeske/lein-cljsbuild :cljsbuild { :builds [{ ; The path to the top-level ClojureScript source directory: :source-paths ["src-cljs"] :compiler { :output-to…
user1028880
4
votes
1 answer

Clojurescript namespace refresh

I am using lein cljsbuild and want to find a way to reload my compiled file without refreshing the browser. Is there a built in way to do this from my browser connected REPL?
Jon Rose
  • 1,457
  • 1
  • 15
  • 25
3
votes
2 answers

"'cljsbuild' not a task"

using lein for clojure, attempting to use the clojurescript plugin. followed all readme.md install steps, project.clj has :dependencies [[org.clojure/clojure "1.7.0"] [org.clojure/clojurescript "0.0-3126"]] ;; lein-cljsbuild…
3
votes
1 answer

Specify the ClojureScript file I want to include

How to specify which ClojureScript file to include in a particular page? Let's say now I have two pages, home and login, and I want only the compiled js from (ns foo.home) to be included in the home page, and only the compiled js from (ns foo.login)…
albusshin
  • 3,930
  • 3
  • 29
  • 57
3
votes
1 answer

Reference external clojurescript namespaces

If in a .cljs file I define a file like this: main.cljs (ns project.main (:use [project.secondfile :only [my-var]])) (js/alert my-var) secondfile.cljs (ns project.secondfile) (def my-var "Hi") I get a "Referred var…
2
votes
1 answer

lein cljsbuild gives "Could not write JavaScript nil" error

Every time I try to run lein cljsbuild once I get an error: Could not write JavaScript nil Any thoughts or ideas would be appreciated as I have been stuck on this for a while and unfortunately cannot go any further. Here is what I have been…
nzaleski
  • 433
  • 5
  • 14
2
votes
2 answers

How to define target env in compile time while building .cljs?

I want to compile my .cljs file for both browser and node.js environments, to get server side rendering. As I understand, there's no way to define cljs env in compile time with reader macro conditions like: #?(:clj ...) #?(:cljs ...) so, I can't…
zarkone
  • 1,335
  • 10
  • 16
2
votes
1 answer

:npm-deps fails "node" not found

I'm trying to use the new :npm-deps feature of the clojurescript compiler to include a React-Helmet component (https://github.com/nfl/react-helmet). Relevant snippet of the "dev" build: :compiler {:main "app.ui.core" :output-to…
fbielejec
  • 3,492
  • 4
  • 27
  • 35
1
2 3