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-blockletVerified import paths — ran on the pinned version, not inferred.
Shows how to set up a basic Vite project with React and the blocklet plugin using createBlockletPlugin.
Update Node.js to version 20 or higher.
Ensure your project uses Vite 5 or higher.
Use named imports like createBlockletPlugin or setupClient.
Add vite-plugin-node-polyfills with protocolImports:true as shown in examples.
Change to: import { createBlockletPlugin } from 'vite-plugin-blocklet';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).
Run: npm install vite@^5