Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/john-bernardo1/sbt-css-compress
sbt-web plugin for minifying/compressing CSS assets
https://github.com/john-bernardo1/sbt-css-compress
Last synced: 3 months ago
JSON representation
sbt-web plugin for minifying/compressing CSS assets
- Host: GitHub
- URL: https://github.com/john-bernardo1/sbt-css-compress
- Owner: john-bernardo1
- License: mit
- Created: 2014-07-10T16:22:03.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-10-09T09:04:05.000Z (over 7 years ago)
- Last Synced: 2024-08-12T14:04:37.694Z (6 months ago)
- Language: Java
- Size: 26.4 KB
- Stars: 7
- Watchers: 3
- Forks: 7
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-sbt-plugins - sbt-css-compress
README
sbt-css-compress
===========
[![Build Status](https://api.travis-ci.org/ground5hark/sbt-css-compress.png?branch=master)](https://travis-ci.org/ground5hark/sbt-css-compress)[sbt-web] plugin which compresses CSS using [yuicompressor].
Plugin
======
Add the plugin to your `project/plugins.sbt`:
```scala
addSbtPlugin("net.ground5hark.sbt" % "sbt-css-compress" % "0.1.4")
```Add the [Sonatype releases] resolver:
```scala
resolvers += Resolver.sonatypeRepo("releases")
```Enable the [sbt-web] plugin for your project:
```scala
lazy val root = (project in file(".")).enablePlugins(SbtWeb)
```Add the `css-compress` task to your asset pipeline in your `build.sbt`:
```scala
pipelineStages := Seq(cssCompress)
```Configuration options
=====================
Option | Description
--------------------|------------
suffix | Extension to append to each compressed file. Defaults to `".min.css"`
parentDir | Parent directory name where compressed CSS will go. Defaults to `""`, which outputs the file into the base target directory
lineBreak | Number of characters on a line before attempting to insert a line break. This is merely a hint to the compressor. Defaults to `-1` (never)An example of providing an option is below:
```scala
CssCompress.suffix := ".min.css"
```This will produce assets with the specified `CssCompress.suffix` suffix value under the `CssCompress.parentDir`
directory within the `target` folder. This will be `target/web/public/main` or `target/web/stage`. You can also specify
`includeFilter in cssCompress` or `excludeFilter in cssCompress` to select files on a custom criteria.License
=======
This code is licensed under the [MIT License].[sbt-web]:https://github.com/sbt/sbt-web
[yuicompressor]:http://yui.github.io/yuicompressor/
[MIT License]:http://opensource.org/licenses/MIT
[Sonatype releases]:https://oss.sonatype.org/content/repositories/releases/