All Projects → preactjs → Preset Vite

preactjs / Preset Vite

Licence: mit
Preset for using Preact with the vite bundler

Programming Languages

typescript
32286 projects

@preact/preset-vite

An all in one preset for writing Preact apps with the vite bundler.

Features:

Installation

First intall the preset package from npm:

npm install --save-dev @preact/preset-vite
# or
yarn add -D @preact/preset-vite

Enhance your vite config with the Preact preset plugin in your vite.config.ts or vite.config.js:

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

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

Options

Options can be passed to our preset plugin via the first argument:

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

Available options

Option Type Default Description
devtoolsInProd boolean false Inject devtools bridge in production bundle instead of only in development mode

License

MIT, see the license file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].