Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–223 runs
build_error
glibcnode 18–223 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default
✓ import blinkoPlugin from 'vite-plugin-blinko'
✗ const blinkoPlugin = require('vite-plugin-blinko')
ESM-only import; CommonJS require will fail.
blinkoPlugin
✓ import blinkoPlugin from 'vite-plugin-blinko'
✗ import { blinkoPlugin } from 'vite-plugin-blinko'
Default export; named import is incorrect.
type BlinkoPluginOptions
✓ import type { BlinkoPluginOptions } from 'vite-plugin-blinko'
✗ import { BlinkoPluginOptions } from 'vite-plugin-blinko'
Use import type for TypeScript types to avoid runtime overhead.
Configures Vite with Preact and the Blinko plugin, customizing build outputs and externals.
// vite.config.ts
import { defineConfig } from 'vite';
import preact from '@preact/preset-vite';
import blinkoPlugin from 'vite-plugin-blinko';
export default defineConfig({
plugins: [
preact(),
...blinkoPlugin({
entry: 'src/main.tsx',
prodOutDir: 'build',
devOutDir: 'dev-build',
pluginJsonPath: './plugin.json',
externals: ['blinko', 'some-other-external'],
useRandomFilename: false
})
]
});
Errors
Common errors & fixes
Error: The plugin must be used with @preact/preset-vite.
Missing Preact preset in Vite config.
fixInstall and add preact() before blinkoPlugin().
Error: Cannot find module 'vite-plugin-blinko'
Package not installed or in node_modules.
fixRun 'npm install vite-plugin-blinko --save-dev'.
TypeError: blinkoPlugin is not a function or function call is missing spread operator
Forgetting to spread the returned array.
fixUse ...blinkoPlugin() instead of blinkoPlugin as a single plugin.
Audit
Dependencies
viteoptionalpeer dependency required for plugin to work