https://github.com/chisel/ease-task-minify-css
CSS minifier for Ease task runner.
https://github.com/chisel/ease-task-minify-css
Last synced: 5 months ago
JSON representation
CSS minifier for Ease task runner.
- Host: GitHub
- URL: https://github.com/chisel/ease-task-minify-css
- Owner: chisel
- Created: 2019-06-30T01:03:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-09T21:43:13.000Z (almost 5 years ago)
- Last Synced: 2024-12-27T07:42:22.882Z (over 1 year ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ease Task Runner CSS Minifier Plugin
This is a plugin for the [Ease task runner](https://github.com/chisel/ease). It uses the [clean-css](https://www.npmjs.com/package/clean-css) module to minify CSS files.
# Installation
```
npm install ease-task-minify-css --save-dev
```
**easeconfig.js:**
```js
const minifyCss = require('ease-task-minify-css');
module.exports = ease => {
ease.install('minify-css', minifyCss, {});
};
```
# Configuration
This plugin takes a config object similar to [Clean CSS Options](https://www.npmjs.com/package/clean-css#constructor-options) while ignoring the property `returnPromise` and adding the following properties:
- `dir`: Path to a directory containing all the SASS files, relative to `easeconfig.js`
- `outDir`: Path to the output directory where the CSS files should be written, relative to `easeconfig.js`
- `cleanOutDir`: Boolean indicating if the output directory should be emptied first
# Example
**easeconfig.js:**
```js
const minifyCss = require('ease-task-minify-css');
module.exports = ease => {
ease.install('minify-css', minifyCss, {
dir: 'css',
outDir: 'css',
cleanOutDir: false,
compatibility: 'ie8',
sourceMap: true
});
ease.job('minify-css-files', ['minify-css']);
};
```
**CLI:**
```
ease minify-css-files
```