# liferay-compress-css

> A js function that integrates with Liferay theme gulp build task to compress /build css &amp; gzip

Latest version **1.0.0** (published 2019-04-11) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install liferay-compress-css
pnpm add liferay-compress-css
yarn add liferay-compress-css
bun add liferay-compress-css
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-04-11 |
| First published | 2019-04-11 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 5 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ryan Garant |
| Maintainers | protoevangelion |
| Keywords | liferay, gulp, theme, compress, gzip |

## Links

- npm: https://www.npmjs.com/package/liferay-compress-css
- Repository: https://github.com/protoEvangelion/liferay-compress-css
- Homepage: https://github.com/protoEvangelion/liferay-compress-css#readme
- Issues: https://github.com/protoEvangelion/liferay-compress-css/issues
- npm.io page: https://npm.io/package/liferay-compress-css

## Dependencies (5)

- [fancy-log](https://npm.io/package/fancy-log.md) ^1.3.3
- [gulp-gzip](https://npm.io/package/gulp-gzip.md) ^1.4.2
- [ansi-colors](https://npm.io/package/ansi-colors.md) ^3.2.4
- [gulp-add-src](https://npm.io/package/gulp-add-src.md) ^1.0.0
- [gulp-clean-css](https://npm.io/package/gulp-clean-css.md) ^4.0.0

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-04-11
- 0.1.0 — 2019-04-11

## README

# liferay-compress-css

> A js function that integrates with Liferay theme gulp build task to compress /build css &amp; gzip

-   Uses [clean css](https://www.npmjs.com/package/clean-css) to minimize css & gzip to compress in Liferay 7.1 themes
-   We use this together with Nginx
-   This is a function that you can add right after your build stage
-   This is a very rigid package and only minimizes the following files from your theme `/build/css` dir:- font_awesome.css - main.css - clay.css (only gzips doesn't minify because it errs on the local import)
    -   if you would like it to handle more options, open an issue & we will try to make it more flexible for your use case

## Install

```
$ npm install liferay-compress-css
```

## Usage

-   in your theme's `gulpfile.js` this is how you can compress the css right after the build step
-   this will happen if gulp is run with `gulp build` or `gulp deploy`
-   make sure to pass it `done` & `gulp`

```js
const gulp = require('gulp');
const liferayThemeTasks = require('liferay-theme-tasks');

const compressCss = require('liferay-compress-css');

liferayThemeTasks.registerTasks({
	gulp: gulp,
	hookFn: function(gulp) {
		gulp.hook('after:build', done => compressCss(done, gulp));
	},
});
```

-   if you don't want it to run when you are in development, just set `NODE_ENV=development`
-   the way we do this is running cross env from npm scripts:

```
	"scripts": {
		"dev": "cross-env NODE_ENV=development gulp build"
	},
```

## License

[BSD-3-Clause](https://github.com/node-gh/gh/blob/master/LICENSE.txt)

---
_Source: https://npm.io/package/liferay-compress-css · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
