New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@preact/preset-vite

Package Overview
Dependencies
Maintainers
10
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@preact/preset-vite

Preact preset for the vite bundler

2.1.3
Source
npm
Version published
Weekly downloads
72K
3.46%
Maintainers
10
Weekly downloads
 
Created
Source

@preact/preset-vite

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

Features:

  • Sets up Hot Module Replacement via prefresh
  • Enables Preact Devtools bridge during development

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

OptionTypeDefaultDescription
devtoolsInProdbooleanfalseInject devtools bridge in production bundle instead of only in development mode

License

MIT, see the license file.

Keywords

preact

FAQs

Package last updated on 04 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts