# @htmelt/plugin

> [UnoCSS](https://github.com/antfu/unocss) plugin for [HTMelt](https://github.com/alloc/htmelt).

Latest version **0.5.1** (published 2024-04-20) · 0 weekly downloads

## Install

```sh
npm install @htmelt/plugin
pnpm add @htmelt/plugin
yarn add @htmelt/plugin
bun add @htmelt/plugin
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2024-04-20 |
| First published | 2023-04-15 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 285.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | aleclarson |

## Links

- npm: https://www.npmjs.com/package/@htmelt/plugin
- npm.io page: https://npm.io/package/@htmelt/plugin

## Dependencies (12)

- [cac](https://npm.io/package/cac.md) ^6.7.14
- [mitt](https://npm.io/package/mitt.md) ^3.0.1
- [mrmime](https://npm.io/package/mrmime.md) ^1.0.1
- [parse5](https://npm.io/package/parse5.md) ^6.0.1
- [esbuild](https://npm.io/package/esbuild.md) ^0.17.19
- [md5-hex](https://npm.io/package/md5-hex.md) ^4.0.0
- [escalade](https://npm.io/package/escalade.md) ^3.1.2
- [@types/node](https://npm.io/package/@types/node.md) ^20.12.7
- [@types/parse5](https://npm.io/package/@types/parse5.md) ^6.0.3
- [esbuild-extra](https://npm.io/package/esbuild-extra.md) ^0.4.0
- [bundle-require](https://npm.io/package/bundle-require.md) ^4.0.2
- [@rollup/pluginutils](https://npm.io/package/@rollup/pluginutils.md) ^5.1.0

## Recent versions

- 0.5.1 (latest) — 2024-04-20
- 0.4.0 — 2024-02-23
- 0.3.4 — 2023-06-06
- 0.3.3 — 2023-06-06
- 0.3.2 — 2023-05-13
- 0.3.1 — 2023-05-13
- 0.3.0 — 2023-05-08
- 0.2.8 — 2023-05-05
- 0.2.7 — 2023-05-02
- 0.2.6 — 2023-04-27
- 0.2.5 — 2023-04-27
- 0.2.4 — 2023-04-27
- 0.2.3 — 2023-04-27
- 0.2.2 — 2023-04-27
- 0.2.1 — 2023-04-27
- … 5 more at https://npm.io/package/@htmelt/plugin/versions

## README

# @htmelt/unocss

[UnoCSS](https://github.com/antfu/unocss) plugin for [HTMelt](https://github.com/alloc/htmelt).

## How It Works

1. It loads your `unocss.config.js` file.
2. It scans your JSX and TSX files for tokens identified by UnoCSS
   plugins/presets.
3. For each JSX and TSX module, it generates a separate CSS file and
   adds it to the document with JavaScript.

## Roadmap

- [ ] Use lightningcss to remove duplicate CSS rules on a per-chunk basis.

## Install

```sh
pnpm install -D @htmelt/unocss
yarn add -D @htmelt/unocss
npm install --save-dev @htmelt/unocss
```

## `import.meta` extensions

The typings of `import.meta` and `import.meta.env` can both be extended
by plugins.

```ts
declare module '@htmelt/plugin/dist/importMeta.mjs' {
  export interface ImportMeta {
    foo: string
  }
  export interface ImportMetaEnv {
    bar: string
  }
}

// Important: Ensure this file is a module
export {}
```

It's recommended to add a `client.d.ts` module to your plugin's root
directory and advise users to include `my-plugin/client` in the `types`
array of their tsconfig (along with `htmelt/client`).

```json
{
  "compilerOptions": {
    "types": ["htmelt/client", "my-plugin/client"]
  }
}
```

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