# @stylable/optimizer

> Stylable core optimizer

Latest version **6.1.1** (published 2024-05-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @stylable/optimizer
pnpm add @stylable/optimizer
yarn add @stylable/optimizer
bun add @stylable/optimizer
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.1.1 |
| Published | 2024-05-30 |
| First published | 2019-03-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18.12.0 |
| Dependencies | 4 |
| Unpacked size | 40.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1274 |
| Author | Wix.com |
| Maintainers | tomrav, avi.vahl, idoros, baraki, cijoe, alexswix |

## Links

- npm: https://www.npmjs.com/package/@stylable/optimizer
- Repository: https://github.com/wix/stylable.git#master
- Homepage: https://stylable.io
- Issues: https://github.com/wix/stylable/issues
- npm.io page: https://npm.io/package/@stylable/optimizer

## Dependencies (4)

- [postcss](https://npm.io/package/postcss.md) ^8.4.38
- [lightningcss](https://npm.io/package/lightningcss.md) ^1.25.1
- [@stylable/core](https://npm.io/package/@stylable/core.md) ^6.1.1
- [@tokey/css-selector-parser](https://npm.io/package/@tokey/css-selector-parser.md) ^0.6.2

## Recent versions

- 6.1.1 (latest) — 2024-05-30
- 5.19.0 (release-5.x) — 2024-03-05
- 6.0.0-rc.3 (next) — 2024-02-01
- 4.15.1 (release-4.x) — 2022-08-14
- 3.13.2 (release-3.x) — 2021-12-09
- 6.1.0 — 2024-05-21
- 6.0.2 — 2024-04-15
- 6.0.1 — 2024-03-19
- 6.0.0 — 2024-03-13
- 5.18.1 — 2024-02-12
- 5.18.0 — 2024-01-14
- 5.17.0 — 2023-12-03
- 6.0.0-rc.2 — 2023-11-08
- 6.0.0-rc.1 — 2023-11-08
- 5.16.1 — 2023-10-05
- … 175 more at https://npm.io/package/@stylable/optimizer/versions

## README

# @stylable/optimizer

[![npm version](https://img.shields.io/npm/v/@stylable/optimizer.svg)](https://www.npmjs.com/package/stylable/optimizer)

Performs optimization when running Stylable in production mode.

### `StylableOptimizer`

Performs optimization such as removing Stylable directives, comments, unused components, empty rules to Stylable's output based on the provided configuration.

The `StylableOptimizer` is also responsible for invoking the `StylableClassNameOptimizer` and `StylableNamespaceOptimizer` based on its configuration.

### `StylableClassNameOptimizer`

Optimizes class names based on usage to a shorter format, being careful not to affect states (which need to stay un-optimized at the moment) and global rules.

### `StylableNamespaceOptimizer`

Optimizes namespaces to a shorter format.

## License
Copyright (c) 2019 Wix.com Ltd. All Rights Reserved. Use of this source code is governed by a [MIT license](./LICENSE).

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