Packages

@preact/preset-vite

2.10.6 · 18 Jul 2026MIT1.4M / weekRepositoryHomepagenpmAtom feed

Your version

2.0.0

major15 Mar 2021Where it was published

2.10.6 is the newest release of 2.x.

In short

2 breaking1 fixed

  • Breaking

    Since this project is very new it was deemed better to do this breaking change now, rather than later when the userbase will be significantly larger.

  • Breaking

    Switch from config factory function to array of plugins (#5, thanks @marvinhagemeister)

Release note

Releasing this preset to the public sparked a discussion on how presets should be done in vite in general. It turns out that plugins can be an array of plugins and that this is the intended approach moving forward. Since this project is very new it was deemed better to do this breaking change now, rather than later when the userbase will be significantly larger.

To update change your vite configuration from wrapping your config:

import withPreact from "@preact/preset-vite";

export default withPreact({
  // Your vite config
});

..to moving it to the plugin array:

import { defineConfig } from "vite";
import preact from "@preact/preset-vite";

export default defineConfig({
  plugins: [preact()]
});

Breaking

Bug Fixes

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.