# @vituum/vite-plugin-twig

> Vite plugin for Twig, transforms twig templates into HTML

Latest version **2.0.1** (published 2026-03-18) · 0 weekly downloads

## Install

```sh
npm install @vituum/vite-plugin-twig
pnpm add @vituum/vite-plugin-twig
yarn add @vituum/vite-plugin-twig
bun add @vituum/vite-plugin-twig
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2026-03-18 |
| First published | 2022-08-13 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^20.19.0 \|\| >=22.12.0 |
| Dependencies | 2 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Maintainers | evromalarkey |
| Keywords | twig, vituum, vite, vite-plugin |

## Links

- npm: https://www.npmjs.com/package/@vituum/vite-plugin-twig
- Repository: https://github.com/vituum/vite-plugin-twig
- Homepage: https://github.com/vituum/vite-plugin-twig#readme
- Issues: https://github.com/vituum/vite-plugin-twig/issues
- npm.io page: https://npm.io/package/@vituum/vite-plugin-twig

## Dependencies (2)

- [twig](https://npm.io/package/twig.md) ^2.0
- [vituum](https://npm.io/package/vituum.md) ^2.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2026-03-18
- 2.0.0-next.1 (next) — 2026-01-20
- 2.0.0 — 2026-03-13
- 1.1.0 — 2023-11-17
- 1.0.0 — 2023-06-27
- 1.0.0-beta.2 — 2023-06-23
- 1.0.0-beta.1 — 2023-06-23
- 1.0.0-alpha.9 — 2023-06-22
- 1.0.0-alpha.7 — 2023-06-21
- 1.0.0-alpha.6 — 2023-06-21
- 1.0.0-alpha.4 — 2023-06-19
- 1.0.0-alpha.3 — 2023-06-19
- 1.0.0-alpha.2 — 2023-06-19
- 1.0.0-alpha.1 — 2023-06-15
- 0.1.7 — 2022-12-15
- … 7 more at https://npm.io/package/@vituum/vite-plugin-twig/versions

## README

<a href="https://npmjs.com/package/@vituum/vite-plugin-twig"><img src="https://img.shields.io/npm/v/@vituum/vite-plugin-twig.svg" alt="npm package"></a>
<a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/@vituum/vite-plugin-twig.svg" alt="node compatility"></a>

# ⚡️🌱 ViteTwig

```js
import twig from '@vituum/vite-plugin-twig'

export default {
    plugins: [
        twig()
    ],
    build: {
        rollupOptions: {
            input: ['index.twig.html']
        }
    }
}
```

* Read the [docs](https://vituum.dev/plugins/twig.html) to learn more about the plugin options.
* Use with [Vituum](https://vituum.dev) to get multi-page support.

## Basic usage

```html
<!-- index.twig with index.twig.json -->
{{ title }}
```
or
```html
<!-- index.json -->
{
  "template": "path/to/template.twig",
  "title": "Hello world"
}
```

### Requirements

- [Node.js LTS (20.x)](https://nodejs.org/en/download/)
- [Vite](https://vitejs.dev/)

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