# cssnano-preset-lite

> Safe and minimum transformation

Latest version **6.0.3** (published 2026-09-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install cssnano-preset-lite
pnpm add cssnano-preset-lite
yarn add cssnano-preset-lite
bun add cssnano-preset-lite
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.0.3 |
| Published | 2026-09-17 |
| First published | 2020-08-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^22.22.3 \|\| ^24.15.0 \|\| >=26.0 |
| Dependencies | 4 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 4975 |
| Maintainers | ludovicofischer, evilebottnawi, anixsaha, cssnano-bot |

## Links

- npm: https://www.npmjs.com/package/cssnano-preset-lite
- Repository: https://github.com/cssnano/cssnano
- Issues: https://github.com/cssnano/cssnano/issues
- npm.io page: https://npm.io/package/cssnano-preset-lite

## Dependencies (4)

- [cssnano-utils](https://npm.io/package/cssnano-utils.md) ^7.0.3
- [postcss-discard-empty](https://npm.io/package/postcss-discard-empty.md) ^9.0.3
- [postcss-discard-comments](https://npm.io/package/postcss-discard-comments.md) ^9.0.3
- [postcss-normalize-whitespace](https://npm.io/package/postcss-normalize-whitespace.md) ^9.0.3

## Recent versions

- 6.0.3 (latest) — 2026-09-17
- 2.0.0-rc.2 (next) — 2021-03-15
- 4.0.0-nightly.2020.2.6 (nightly) — 2021-02-06
- 6.0.2 — 2026-09-05
- 6.0.1 — 2026-09-01
- 6.0.0 — 2026-08-27
- 5.0.6 — 2026-08-26
- 5.0.5 — 2026-08-20
- 5.0.4 — 2026-08-16
- 5.0.3 — 2026-08-09
- 5.0.2 — 2026-08-04
- 5.0.1 — 2026-06-11
- 5.0.0 — 2026-05-06
- 4.0.6 — 2026-05-02
- 4.0.5 — 2026-04-20
- … 32 more at https://npm.io/package/cssnano-preset-lite/versions

## README

# cssnano-preset-lite

> Safe and minimum transformation with just removing whitespaces, line breaks and comments

## Table of Contents

- [Overview](#overview)

- [Usage](#usage)

  - [Install](#install)
  - [Configuration](#configuration)

- [Plugins](#plugins)

  - [cssnano-utils](#cssnano-utils)
  - [postcss-discard-comments](#postcss-discard-comments)
  - [postcss-discard-empty](#postcss-discard-empty)
  - [postcss-normalize-whitespace](#postcss-normalize-whitespace)

- [Contributors](#contributors)

- [License](#license)

## Overview

This lite preset for cssnano only includes transforms that only removes extra whitespace,
linebreaks, and comments.

## Usage

### Install

With [npm](https://npmjs.com/package/cssnano-preset-lite) do:

    npm install cssnano-preset-lite --save-dev

If you don't have npm then [check out this installation tutorial](https://npmjs.com/package/cssnano-preset-lite/tutorial).

### Configuration

If you would like to use the default configuration, then you don't need any additional configuration.

But should you wish to customise this, you can pass an array with the second parameter as the options object to use. For example, to remove all comments:

```diff
 {
   "name": "awesome-application",
+  "cssnano": {
+    "preset": [
+      "lite",
+      {"discardComments": {"removeAll": true}}
+    ]
+  }
 }
```

Depending on your usage, the JSON configuration might not work for you, such as in cases where you would like to use options with customisable function parameters.
For this use case, create use a `cssnano.config.js`. You can then load a preset and export it with your custom parameters:

```js
const defaultPreset = require('cssnano-preset-lite');

module.exports = defaultPreset({
  discardComments: {
    remove: (comment) => comment[0] === '@',
  },
});
```

Note that you may wish to publish your own preset to npm for reusability, should it differ a lot from this one. This is highly encouraged!

## Plugins

### [`cssnano-utils`](https://github.com/cssnano/cssnano/tree/main/packages/cssnano-utils)

> Utility methods used by cssnano


### [`postcss-discard-comments`](https://github.com/cssnano/cssnano/tree/main/packages/postcss-discard-comments)

> Discard comments in your CSS files with PostCSS.

This plugin is loaded with its default configuration.

### [`postcss-discard-empty`](https://github.com/cssnano/cssnano/tree/main/packages/postcss-discard-empty)

> Discard empty rules and values with PostCSS.

This plugin is loaded with its default configuration.

### [`postcss-normalize-whitespace`](https://github.com/cssnano/cssnano/tree/main/packages/postcss-normalize-whitespace)

> Trim whitespace inside and around CSS rules & declarations.

This plugin is loaded with its default configuration.


## Contributors

See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/main/CONTRIBUTORS.md).

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