@chasket/vite-plugin-chasket
v0.2.2
Published
Vite plugin for Chasket (.csk) components — compile .csk files to Web Components with HMR support
Maintainers
Readme
@chasket/vite-plugin-chasket
Part of the Chasket ecosystem.
Vite plugin for compiling .csk files with Hot Module Replacement support.
Zero dependencies (peer-depends on vite and @chasket/chasket).
Installation
npm install -D vite-plugin-chasket @chasket/chasketSetup
// vite.config.js
import chasket from 'vite-plugin-chasket';
export default {
plugins: [chasket()],
};Options
chasket({
target: 'js', // Output target: 'js' | 'ts'
optimize: false, // Enable tree-shaking optimization
sourceMap: true, // Generate source maps
})| Option | Type | Default | Description |
|--------|------|---------|-------------|
| target | 'js' \| 'ts' | 'js' | Compiler output target |
| optimize | boolean | false | Tree-shaking optimization |
| sourceMap | boolean | true | Source map generation |
Features
Transform — Automatically detects and compiles .csk files to JavaScript.
// Import .csk files directly
import './components/my-button.csk';
import './components/my-card.csk';HMR — Reloads on .csk file changes. Full reload by default; fine-grained HMR planned for a future release.
Error overlay — Compile errors display in Vite's browser error overlay. Warnings are logged to the console.
Import resolution — Resolves relative imports between .csk files automatically.
Part of the Chasket ecosystem
This package is part of Chasket, a template-first Web Component compiler.
