cljs.build.api

Added in 0.0-2496

add-dependencies - function
(add-dependencies opts & ijss)
Given one or more IJavaScript objects in dependency order, produce
a new sequence of IJavaScript objects which includes the input list
plus all dependencies in dependency order.

add-implicit-options - function
(add-implicit-options opts)
Given a valid map of build options add any standard implicit options. For
example :optimizations :none implies :cache-analysis true and :source-map
true.

build - function
(build source opts)
(build source opts compiler-env)
Given a source which can be compiled, produce runnable JavaScript.

cljs-dependents-for-macro-namespaces - function
(cljs-dependents-for-macro-namespaces namespaces)
(cljs-dependents-for-macro-namespaces state namespaces)
Takes a list of Clojure (.clj) namespaces that define macros and
returns a list ClojureScript (.cljs) namespaces that depend on those macro
namespaces.

For example where example.macros is defined in the clojure file
"example/macros.clj" and both 'example.core and 'example.util are
ClojureScript namespaces that require and use the macros from
'example.macros :
(cljs-dependents-for-macro-namespaces 'example.macros) ->
('example.core 'example.util)

compile - function
(compile opts compilable)
(compile state opts compilable)
Given a Compilable, compile it and return an IJavaScript.

goog-dep-string - function
(goog-dep-string opts ijs)
Given compiler options and a IJavaScript instance return the corresponding
goog.addDependency string

inputs - function
(inputs & xs)
Given a list of directories and files, return a compilable object that may
be passed to build or watch.

mark-cljs-ns-for-recompile! - function
(mark-cljs-ns-for-recompile! ns-sym)
(mark-cljs-ns-for-recompile! ns-sym output-dir)
Backdates a cljs target file so that it the cljs compiler will recompile it.

node-inputs - function
(node-inputs entries)
EXPERIMENTAL: return the foreign libs entries as computed by running
the module-deps package on the supplied JavaScript entry points. Assumes
that the module-deps NPM packages is either locally or globally installed.

node-module-deps - function
(node-module-deps entry)
EXPERIMENTAL: return the foreign libs entries as computed by running
the module-deps package on the supplied JavaScript entry point. Assumes
that the module-deps NPM package is either locally or globally installed.

ns->location - function
(ns->location ns)
(ns->location ns compiler-env)
Given a namespace and compilation environment return the relative path and
uri of the corresponding source regardless of the source language extension:
.cljs, .cljc, .js. Returns a map containing :relative-path a string, and
:uri a URL.

ns->source - function
(ns->source ns)
Given a namespace as a symbol return the corresponding resource if it exists.

output-unoptimized - function
(output-unoptimized opts & sources)
Ensure that all JavaScript source files are on disk (not in jars),
write the goog deps file including only the libraries that are being
used and write the deps file for the current project.

The deps file for the current project will include third-party
libraries.

parse-js-ns - function
(parse-js-ns f)
Given a Google Closure style JavaScript file or resource return the namespace
information for the given file. Only returns the value extracted from the
first provide statement.

source-on-disk - function
(source-on-disk opts ijs)
Ensure that the given IJavaScript exists on disk in the output directory.
Return updated IJavaScript with the new location if necessary.

src-file->goog-require - function
(src-file->goog-require src)
(src-file->goog-require src options)
(src-file->goog-require state src options)
Given a ClojureScript or Google Closure style JavaScript source file return
the goog.require statement for it.

src-file->target-file - function
(src-file->target-file src)
(src-file->target-file src opts)
(src-file->target-file state src opts)
Given a ClojureScript source file return the target file. May optionally
provide build options with :output-dir specified.

target-file-for-cljs-ns - function
(target-file-for-cljs-ns ns-sym)
(target-file-for-cljs-ns ns-sym output-dir)
Given an output directory and a clojurescript namespace return the
compilation target file for that namespace.

For example:
(target-file-from-cljs-ns "resources/out" 'example.core) ->

watch - function
(watch source opts)
(watch source opts compiler-env)
(watch source opts compiler-env stop)
Given a source which can be compiled, watch it for changes to produce.