1.0.10 • Published 7 years ago

cssqueeze v1.0.10

Weekly downloads
5
License
ISC
Repository
github
Last release
7 years ago

cssqueeze

A CLI wrapper for cssnano

What is it?

A CLI tool that runs CSS files through a set of optimizations provided by cssnano. It exposes a bin called cssqueeze.

Installation

Install via npm which is bundled with node:

$ npm install -g cssqueeze

CLI Usage

$ cssqueeze --source source.css --destination bundle.min.css
# squeezed into -> ./bundle.min.css

Include a [hash] in the destination filename to generate a unique hash code based on the source content:

$ cssqueeze --source source.css --destination bundle.[hash].min.css
# squeezed into -> ./bundle.0d422da9649ff811b3c90224cca0680c.min.css

See cssqueeze --help for more info.

Custom Configuration

This tool uses cssnano as the optimization module. By default it wil use all advanced optimizations provided by cssnano.

Use the --config flag to pass a custom json configuration file. This allows you to enable / disable optimizations and to pass options to the individual optimization modules.

$ cssqueeze --custom config.json

The following configuration file disables the postcss-discard-comments plugin and sets autoprefixer browser targets to those that have more than 5% global usage statistics.

{
  "source": "./source.config.css",
  "destination": "./bundle.[hash].min.css",
  "plugins": {
    "postcss-discard-comments": false,
    "autoprefixer": {
      "browsers": ["> 5%"],
      "add": true
    }
  }
}
1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago