Skip to content

Commit

Permalink
Merge pull request #54 from rangeoshun/update-assets-minifier-to-allo…
Browse files Browse the repository at this point in the history
…w-es6-minification

Update asset-minifier to allow es6 minification #53
  • Loading branch information
Deraen authored Oct 25, 2018
2 parents 23fcc5c + 3f2b18b commit 4eff849
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.boot
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[org.clojure/clojurescript "1.9.946" :scope "test"]
[cljsjs/react-dom "16.1.0-0" :scope "test"]
;; Conflicts with cljs
#_[asset-minifier "0.2.4" :scope "test" :exclusions []]])
#_[asset-minifier "0.2.6" :scope "test" :exclusions []]])

(def +version+ "0.10.1")

Expand Down
8 changes: 5 additions & 3 deletions src/cljsjs/boot_cljsjs/packaging.clj
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
c/commit!)))))

(defn minifier-pod []
(pod/make-pod (assoc-in (c/get-env) [:dependencies] '[[asset-minifier "0.2.4"]])))
(pod/make-pod (assoc-in (c/get-env) [:dependencies] '[[asset-minifier "0.2.6"]])))

(c/deftask minify
"Minifies .js and .css files based on their file extension
Expand All @@ -236,7 +236,8 @@
NOTE: potentially slow when called with watch or multiple times"
[i in INPUT str "Path to file to be compressed"
o out OUTPUT str "Path to where compressed file should be saved"
l lang LANGUAGE_IN kw "Language of the input javascript file. Default value is ecmascript3."]
l lang-in LANGUAGE_IN kw "Language of the input javascript file. Default value is ecmascript6"
L lang-out LANGUAGE_OUT kw "Language of the input javascript file. Default value is ecmascript5"]
(assert in "Path to input file required")
(assert out "Path to output file required")
(let [tmp (c/tmp-dir!)
Expand All @@ -254,7 +255,8 @@
(pod/with-eval-in min-pod
(require 'asset-minifier.core)
(asset-minifier.core/minify-js ~in-path ~out-path (if ~lang
{:language ~lang}
{:language-in ~lang-in
:language-out (or ~lang-out ~lang-in)}
{})))
(. in-path (endsWith "css"))
(pod/with-eval-in min-pod
Expand Down

0 comments on commit 4eff849

Please sign in to comment.