Registry / web-framework / vite-plugin-blocklet

vite-plugin-blocklet

JSON →
library0.14.6jsnpmunverified

A Vite library plugin that enhances development of ArcBlock blocklets. Current stable version is 0.14.6. It integrates with Vite 5+ and provides utilities like createBlockletPlugin for Vite config and setupClient for backend Express apps. Key differentiators: it bridges Vite development with ArcBlock's blocklet framework, supports both front-end and back-end projects, and offers flexible configuration via vite.config.js. Release cadence is not documented but appears active. Requires Node.js >=20.

npm install vite-plugin-blocklet
INSTALL
IMPORT
SIG · VITE-PLUGIN-BLOCKL
V
vite-plugin-blocklet
web-frameworkjavascriptv0.14.6
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.

createBlockletPlugin
import { createBlockletPlugin } from 'vite-plugin-blocklet'
const createBlockletPlugin = require('vite-plugin-blocklet')
For Vite config files (ESM context), use import. CommonJS require works in Node.js scripts outside Vite.
setupClient
const { setupClient } = require('vite-plugin-blocklet')
import { setupClient } from 'vite-plugin-blocklet'
For backend scripts (CommonJS), use require. ESM import may work in Node.js with type:module, but examples use CommonJS.
default export
import plugin from 'vite-plugin-blocklet'
const plugin = require('vite-plugin-blocklet')
The package does not export a default; named exports only. Using default import will result in undefined.

Shows how to set up a basic Vite project with React and the blocklet plugin using createBlockletPlugin.

// vite.config.js import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import { createBlockletPlugin } from 'vite-plugin-blocklet'; export default defineConfig(async () => { return { plugins: [react(), createBlockletPlugin()], }; });
Debug
Known issues
breakingRequires Node.js >=20.0.0
fix
Update Node.js to version 20 or higher.
affects: >=0.14.6
breakingPeer dependency Vite >=5
fix
Ensure your project uses Vite 5 or higher.
affects: >=0.14.6
gotchaNo default export; only named exports available
fix
Use named imports like createBlockletPlugin or setupClient.
affects: all
deprecatedUsage without nodePolyfills may cause errors in browser environment
fix
Add vite-plugin-node-polyfills with protocolImports:true as shown in examples.
affects: all
Errors
Common errors & fixes
TypeError: createBlockletPlugin is not a function
Incorrect import: using default import instead of named import.
fix
Change to: import { createBlockletPlugin } from 'vite-plugin-blocklet';
ERR_REQUIRE_ESM: require() of ES Module
Trying to require an ES module in a CommonJS context. The package may be ESM-only in newer versions.
fix
Use dynamic import() or switch to ESM? For now, use named exports with require? Actually, the package appears to support both, but ensure your script is CommonJS (no type:module).
Error: Cannot find module 'vite'
Vite peer dependency not installed.
fix
Run: npm install vite@^5
Upgrade
Version history
0.14.6latest on npm
Audit
Dependencies
viterequiredpeer dependency; Vite >=5 is required for the plugin to work
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
vite-plugin-blocklet — npm install vite-plugin-blocklet · libregistry