vite-plugin-pawajs

raw JSON →
0.0.4 verified Fri May 01 auth: no javascript

A Vite plugin for PawaJS component files that ensures minifier-safe return statements and injects automatic component names. Current version 0.0.4, actively maintained. Uses estree-walker and magic-string for AST transforms. Works with JavaScript and TypeScript. Differentiates by specifically targeting PawaJS framework, unlike general-purpose Vite plugins.

error Cannot read properties of undefined (reading 'length')
cause Plugin may fail if input file is empty or has no component registration.
fix
Ensure .pawa files contain at least one component export or non-empty source.
error Error: Could not source map for ...
cause Magic-string source map generation might conflict if other plugins also manipulate the same file.
fix
Reorder plugins: pawajsPlugin before other transform plugins.
error SyntaxError: Unexpected token
cause PawaJS files contain syntax not yet supported by estree-walker or Vite parser.
fix
Check that your .pawa file uses valid PawaJS syntax; avoid experimental ECMAScript features.
gotcha Plugin only transforms files with .pawa extension. Other files are ignored.
fix Ensure your PawaJS component files have .pawa extension.
breaking Version 0.0.4 may have breaking changes from earlier versions due to early development stage.
fix Check release notes and update your config as needed.
deprecated The plugin is still in early development; APIs may change without major version bump.
fix Lock your dependency version and monitor changelog.
npm install pawajs-vite-plugin
yarn add pawajs-vite-plugin
pnpm add pawajs-vite-plugin

Integrate the PawaJS Vite plugin into your Vite configuration to enable component transformation.

// vite.config.ts
import { defineConfig } from 'vite';
import { pawajsPlugin } from 'vite-plugin-pawajs';

export default defineConfig({
  plugins: [pawajsPlugin()]
});

// Then use .pawa files in your project