
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@preact/preset-vite
Advanced tools
An all in one preset for writing Preact apps with the vite bundler.
Features:
preact/compat
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 can be passed to our preset plugin via the first argument:
export default defineConfig({
plugins: [
preact({ devtoolsInProd: true })
]
});
Option | Type | Default | Description |
---|---|---|---|
devToolsEnabled | boolean | true | Inject devtools bridge |
prefreshEnabled | boolean | true | Inject Prefresh for HMR |
devtoolsInProd | boolean | false | Inject devtools bridge in production bundle instead of only in development mode |
reactAliasesEnabled | boolean | true | Aliases react , react-dom to preact/compat |
The babel
option lets you add plugins, presets, and other configuration to the Babel transformation performed on each JSX/TSX file.
preact({
babel: {
presets: [...],
// Your plugins run before any built-in transform (eg: Fast Refresh)
plugins: [...],
// Use .babelrc files
babelrc: true,
// Use babel.config.js files
configFile: true,
}
})
MIT, see the license file.
FAQs
Preact preset for the vite bundler
The npm package @preact/preset-vite receives a total of 46,360 weekly downloads. As such, @preact/preset-vite popularity was classified as popular.
We found that @preact/preset-vite demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.