Liking cljdoc? Tell your friends :D

shadow.build.closure


add-input-source-mapsclj

(add-input-source-maps {:keys [build-sources] :as state} cc)
source

add-sm-location-mappingsclj

(add-sm-location-mappings co state sources)
source

add-sources-to-source-mapclj

(add-sources-to-source-map state source-map)
source

as-module-exportsclj

(as-module-exports defs)
source

cache-affecting-optionsclj

source

checkclj

(check state)
source

check-levelsclj

source

clean-collected-propertiesclj

(clean-collected-properties properties)
source

closure-source-fileclj

(closure-source-file name code)
source

compile-js-modulesclj

(compile-js-modules {:shadow.build.closure/keys [externs modules compiler
                                                 compiler-options]
                     :as state})
source

constants-injectclj

source

convert-sourcesclj

(convert-sources state sources)

convert and caches closure js sources

convert and caches closure js sources
sourceraw docstring

convert-sources*clj

(convert-sources* {:keys [project-dir npm mode] :as state}
                  sources
                  cached-sources)

takes a list of :js sources and rewrites them to using closure partial compiles must supply the cached sources so closure doesn't complain about things it cannot resolve

takes a list of :js sources and rewrites them to using closure
partial compiles must supply the cached sources so closure doesn't complain about things
it cannot resolve
sourceraw docstring

convert-sources-simpleclj

(convert-sources-simple state sources)

convert and caches

convert and caches
sourceraw docstring

convert-sources-simple*clj

(convert-sources-simple* {:keys [project-dir js-options npm mode build-sources]
                          :as state}
                         sources)

takes a list of :npm sources and rewrites in a browser compatible way, no full conversion

takes a list of :npm sources and rewrites in a browser compatible way, no full conversion
sourceraw docstring

default-externsclj

source

dump-js-modulesclj

(dump-js-modules modules)
source

extern-globals-from-cljsclj

(extern-globals-from-cljs state)
source

extern-props-from-cljsclj

(extern-props-from-cljs state)
source

externs-for-buildclj

(externs-for-build {:keys [build-id externs-file] :as state})
source

generate-externsclj

(generate-externs state)
source

get-js-module-requiresclj

(get-js-module-requires {:shadow.build.closure/keys [dead-modules] :as state}
                        js-module)
source

goog-nodeGlobalRequire-fixclj

source

injected-libraries-fieldclj

source

js-error-xfclj

(js-error-xf state cc)
source

known-js-globalsclj

source

lang-key->lang-modeclj

(lang-key->lang-mode key)
source

load-extern-propertiesclj

(load-extern-properties {:shadow.build.closure/keys [extern-properties]
                         :as state})
source

load-externsclj

(load-externs {:keys [deps-externs] :as state} generate?)
source

log-warningsclj

(log-warnings {:shadow.build.closure/keys [compiler result] :as state})
(log-warnings state compiler result)
source

make-closure-compilerclj

(make-closure-compiler)
(make-closure-compiler out-or-error-manager)
source

make-js-module-per-sourceclj

(make-js-module-per-source {:keys [compiler-env build-sources] :as state})
source

make-js-modulesclj

(make-js-modules {:keys [build-modules closure-configurators compiler-options
                         build-sources polyfill-js]
                  :as state})
source

make-location-mappingclj

source

make-optionsclj

(make-options)
source

module-wrap-npmclj

(module-wrap-npm {:shadow.build.closure/keys [modules dead-modules dead-sources]
                  :as state})

adds npm specific prepend/append but does not modify output

must be called after strip-dead-modules can't do this before compiling since we need to know which modules where removed

adds npm specific prepend/append but does not modify output

must be called after strip-dead-modules
can't do this before compiling since we need to know which modules where removed
sourceraw docstring

noop-error-managerclj

(noop-error-manager)
source

optimizeclj

(optimize {:keys [build-options build-modules] :as state})

takes the current defined modules and runs it through the closure compiler

takes the current defined modules and runs it through the closure compiler
sourceraw docstring

polyfill-nameclj

source

read-variable-mapclj

(read-variable-map state name)
source

read-variable-mapsclj

(read-variable-maps {:shadow.build.closure/keys [compiler compiler-options]
                     :as state})
source

register-cljs-protocol-propertiesclj

(register-cljs-protocol-properties {:shadow.build.closure/keys
                                      [compiler compiler-options]
                                    :keys [compiler-env build-sources]
                                    :as state})

this is needed to make :check-types work

It registers all known CLJS protocols with the Closure TypeRegistry each method is as a property on Object since most of the time Closure doesn't know the proper type and annotating everything seems unlikely.

this is needed to make :check-types work

It registers all known CLJS protocols with the Closure TypeRegistry
each method is as a property on Object since most of the time Closure doesn't know the proper type
and annotating everything seems unlikely.
sourceraw docstring

replace-file-referencesclj

(replace-file-references
  state
  {:keys [resource-name ns js-requires js-imports js-str-offsets] :as rc}
  source)

extremely hacky way to escape the mess that is NODE ModuleResolver replacing all require/imports with absolute file paths so we can use BROWSER

this lets us use our resolve behavior and custom :resolve configs, no need to feed package.json files to the compiler.

other option would be to file a proper PR to turn ModuleLoader into an interface so we can control the lookup behavior.

could also do this as a compiler pass but there is no way to run a compiler pass BEFORE the module stuff is resolved.

doing this via string replacement since parsing the ast and emitting JS would require source maps twice, ie. way more work. JSInspector already recorded all the locations we need.

extremely hacky way to escape the mess that is NODE ModuleResolver
replacing all require/imports with absolute file paths so we can use BROWSER

this lets us use our resolve behavior and custom :resolve configs, no need to feed
package.json files to the compiler.

other option would be to file a proper PR to turn ModuleLoader into an interface
so we can control the lookup behavior.

could also do this as a compiler pass but there is no way to run a compiler pass
BEFORE the module stuff is resolved.

doing this via string replacement since parsing the ast and emitting JS would
require source maps twice, ie. way more work. JSInspector already recorded all the
locations we need.
sourceraw docstring

require-replacement-mapclj

(require-replacement-map {:keys [str->sym sym->id] :as state})
source

rewrite-node-global-accessclj

(rewrite-node-global-access js)
source

set-optionsclj

(set-options closure-opts opts state)
source

setupclj

(setup
  {:shadow.build.closure/keys [modules] :keys [compiler-options] :as state})
source

SHADOW-CACHE-KEYclj

source

should-expand-modules?clj

(should-expand-modules? {:keys [build-modules] :as state})
source

source-map-sourcesclj

(source-map-sources state)
source

strip-dead-modulesclj

(strip-dead-modules {:shadow.build.closure/keys [modules] :as state})

remove any modules that were completely eliminated or moved by closure

must be called after compile-js-modules this would leave empty files otherwise that nobody needs

remove any modules that were completely eliminated or moved by closure

must be called after compile-js-modules
this would leave empty files otherwise that nobody needs
sourceraw docstring

throw-errors!clj

(throw-errors! {:shadow.build.closure/keys [compiler result] :as state})
(throw-errors! state compiler result)
source

use-variable-maps?clj

(use-variable-maps? state)
source

warning-typesclj

source

write-variable-mapclj

(write-variable-map state name map)
source

write-variable-mapsclj

(write-variable-maps {:shadow.build.closure/keys [result] :as state})
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close