Vite plugin for building pilets (micro frontends) in the Piral ecosystem. Current stable version is 1.4.0, released with provenance attestation. This plugin integrates Piral's pilet build process into Vite, enabling fast development and HMR for micro frontend modules. It supports pilet schema v3, standard Vite config files (vite.config.js/ts), and works with both ESM and CJS since v1.2.0. Key differentiators: tight integration with Piral's toolchain, automatic code generation via companion plugin, and support for source maps and CSS handling.
npm install vite-plugin-piletVerified import paths — ran on the pinned version, not inferred.
Shows how to configure Vite with vite-plugin-pilet in a vite.config.ts file, including required options.
Convert your project to ESM (use import syntax) or use dynamic import().
Update your pilet configuration to use schemaVersion: 'v3'.
Ensure a valid Vite config file exists in the root directory of your pilet project.
Add `sourcemap: true` to your Vite config's build options.
Let the plugin manage NODE_ENV; remove any custom define for it.
Run `npm install vite-plugin-pilet` and ensure your project uses ESM (type: module in package.json).
Use `import vitePluginPilet from 'vite-plugin-pilet'` (default import).
Set `schemaVersion: 'v3'` in the plugin options.
Provide a valid `api` option pointing to your Piral instance's pilet API.
Create a `vite.config.js` or `vite.config.ts` in the root directory of your pilet project.