UNPKG

zomoc

Version:

A type-safe API mocking tool for frontend development, powered by axios and Zod.

20 lines (17 loc) 954 B
import { Plugin } from 'vite'; import { ZomocVitePluginOptions } from './types.cjs'; import 'zod'; /** * The main Vite plugin for Zomoc. * It creates a virtual module `virtual:zomoc` that provides the auto-generated Zod schemas * and mock registries. It also handles Hot Module Replacement (HMR) to regenerate the * module when relevant source files (`mock.json`, interfaces) are changed. * @description Zomoc을 위한 메인 Vite 플러그인입니다. * 자동으로 생성된 Zod 스키마와 Mock 레지스트리를 제공하는 가상 모듈 `virtual:zomoc`을 생성합니다. * 또한, 관련된 소스 파일(`mock.json`, 인터페이스 파일 등)이 변경될 때 * 모듈을 재생성하기 위해 HMR(Hot Module Replacement)을 처리합니다. * * @param options - Plugin options to specify paths for mock files and interfaces. */ declare function zomoc(options?: ZomocVitePluginOptions): Plugin; export { zomoc as default };