https://github.com/martinklepsch/boot-gzip
Boot task to gzip files and nothing else.
https://github.com/martinklepsch/boot-gzip
Last synced: 2 months ago
JSON representation
Boot task to gzip files and nothing else.
- Host: GitHub
- URL: https://github.com/martinklepsch/boot-gzip
- Owner: martinklepsch
- License: epl-1.0
- Created: 2015-06-08T13:41:04.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-12-28T17:09:52.000Z (over 8 years ago)
- Last Synced: 2025-04-10T14:17:06.423Z (2 months ago)
- Language: CSS
- Homepage:
- Size: 14.6 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# boot-gzip
Boot task to `gzip` files and nothing else.
[](dependency)
```clojure
[org.martinklepsch/boot-gzip "0.1.3"] ;; latest release
```
[](/dependency)## Usage
**In a shell**
In a terminal you can gzip any files without having a Boot based project present like this:
```
;; you can use --files or just -f
boot --resource-paths "resources" \
-d org.martinklepsch/boot-gzip gzip \
gzip --files normalize.css:n.css.gz -f reset.css:r.css.gz
```**In your `build.boot`**
```
(require '[org.martinklepsch.boot-gzip :refer [gzip]])(deftask compress []
(gzip :files {"normalize.css" "n.css.gz"
"reset.css" "r.css.gz"}
;; Also you can compress files matching regular expressions:
:regex [#"nested/*"]))
```The tasks output will look show original and new filesizes as well savings in percent.
```
Gzipped nested/norm.css (7.6 KiB) to nested/norm.css.gz (2.5 KiB), saving 67%
Gzipped normalize.css (7.6 KiB) to n.css.gz (2.5 KiB), saving 67%
Gzipped reset.css (1.1 KiB) to r.css.gz (615 B), saving 44%
```
**You can try this in the `example/` directory of this project**## Options
See the [boot project](https://github.com/boot-clj/boot) for more information
on how to use these.```clojure
[r regex REGEX [regex] "Gzip all matching files to their respective location and append .gz"
f files ORIGIN:TARGET {str str} "{origin target} map of files to gzip"]
```## License
Copyright Martin Klepsch 2014.
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.