JS merge and minifier
Add the following dependency to your project.clj file:
[jsify "0.1.1-SNAPSHOT"]
(require '[jsify :as jsify])
(def jsify-settings {
:engine :v8
:cache-mode :development
:compress false
:cache-root "resources/public/js/"
:asset-roots "resources/private/js/"
:log-level :quiet
})For noir
(noir/add-middleware jsify/jsify-middleware jsify-settings)For ring
(-> app (jsify/jsify-middleware jsify-settings))To get the link to the output simply use:
(jsify/link-to-asset "app.jsify" jsify-settings)resources/private/js/app.jsify will look like this:
[
"plugin.jquery.js"
"init.js"
"assets/"
"more.js"
]JSify will only rebuild the javascript when files are changed.