Registry / web-framework / pawajs-vite-plugin

pawajs-vite-plugin

JSON →
library0.0.4jsnpmunverified

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.

npm install pawajs-vite-plugin
INSTALL
IMPORT
SIG · PAWAJS-VITE-PLUGIN
P
pawajs-vite-plugin
web-frameworkjavascriptv0.0.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pawajsPlugin
import { pawajsPlugin } from 'vite-plugin-pawajs'
import pawajsPlugin from 'vite-plugin-pawajs'
Plugin is a named export, not default. This is the only export.
pawajsPlugin
const { pawajsPlugin } = require('vite-plugin-pawajs');
const pawajsPlugin = require('vite-plugin-pawajs');
CJS require works but must destructure the named export.
pawajsPlugin
// In vite.config.ts import { pawajsPlugin } from 'vite-plugin-pawajs'
import pawajsPlugin from 'vite-plugin-pawajs';
Using default import will fail with error 'pawajsPlugin is not a function'.

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
Debug
Known issues
gotchaPlugin only transforms files with .pawa extension. Other files are ignored.
fix
Ensure your PawaJS component files have .pawa extension.
affects: >=0.0.1
breakingVersion 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.
affects: <0.0.4
deprecatedThe plugin is still in early development; APIs may change without major version bump.
fix
Lock your dependency version and monitor changelog.
affects: >=0.0.1
Errors
Common errors & fixes
Cannot read properties of undefined (reading 'length')
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: Could not source map for ...
Magic-string source map generation might conflict if other plugins also manipulate the same file.
fix
Reorder plugins: pawajsPlugin before other transform plugins.
SyntaxError: Unexpected token
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.
Upgrade
Version history
0.0.4latest on npm
Audit
Dependencies
viterequiredPeer dependency: plugin runs only within Vite build pipeline.
estree-walkerrequiredUsed to traverse and transform AST nodes.
magic-stringrequiredUsed for efficient source string manipulation.
Agent activity
2 hits · last 30 days
node
2
Resources
pawajs-vite-plugin — npm install pawajs-vite-plugin · libregistry