Registry / web-framework / vite-plugin-blinko

vite-plugin-blinko

JSON →
library1.0.1jsnpmunverified

A Vite plugin specifically designed for developing Blinko plugins. It integrates with Preact and automates the build configuration, validation of plugin.json, and output management. Current stable version 1.0.1, follows semantic versioning. Key differentiators: custom entry point, separate prod/dev output dirs, external dependency injection, and random filename generation for dev builds. Requires Vite ^4.0.0 and Preact preset.

npm install vite-plugin-blinko
INSTALL
IMPORT
SIG · VITE-PLUGIN-BLINKO
V
vite-plugin-blinko
web-frameworkjavascriptv1.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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
musl
node 18223 runs
build_error
glibc
node 18223 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 }) ] });
Debug
Known issues
gotchauseRandomFilename defaults to true; random filenames can break asset caching in production.
fix
Set useRandomFilename: false in production builds.
affects: 1.0.0
gotchaThe plugin returns an array, not a single object; must be spread with '...blinkoPlugin()'.
fix
Use ...blinkoPlugin() in the plugins array.
affects: >=1.0.0
breakingIn version 1.0.0, the default entry was 'src/index.tsx'; in 1.0.1 it changed to 'src/main.tsx'? The README shows 'src/main.tsx' as example but docs say 'src/index.tsx'. Check actual default.
fix
Explicitly set the entry option to avoid reliance on default.
affects: >=1.0.0
Errors
Common errors & fixes
Error: The plugin must be used with @preact/preset-vite.
Missing Preact preset in Vite config.
fix
Install and add preact() before blinkoPlugin().
Error: Cannot find module 'vite-plugin-blinko'
Package not installed or in node_modules.
fix
Run '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.
fix
Use ...blinkoPlugin() instead of blinkoPlugin as a single plugin.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
viteoptionalpeer dependency required for plugin to work
Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
vite-plugin-blinko — npm install vite-plugin-blinko · libregistry