Vite plugin for compiling .cpat files (Clarity Pattern files) using clarity-pattern-parser. Current stable version is 0.1.9. The plugin integrates with Vite's build pipeline to parse .cpat files and export patterns as JavaScript modules. Low release cadence, requires TypeScript module augmentation for type safety. Alternative to manual parsing workflows, designed specifically for Vite projects.
npm install vite-cpatVerified import paths — ran on the pinned version, not inferred.
Registers the Vite plugin to handle .cpat files in your project.
Install clarity-pattern-parser: yarn add clarity-pattern-parser
Add declare module '*.cpat' { ... } as shown in READMEUse import syntax instead of require()
Install the package and ensure 'moduleResolution' is set to 'node16' or 'bundler' in tsconfig.json
Add the declare module '*.cpat' block from the README to a global .d.ts file