@kevbook/vite-plugin-custom-validator
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

vite-plugin-custom-validator

Vite plugin to add a custom validator function at build or dev time (hot module update).

Usage

$ pnpm add -D @kevbook/vite-plugin-custom-validator
// vite.config.ts
import { defineConfig } from 'vite';
import { customValidator } from 'vite-plugin-custom-validator';

export default defineConfig({
  plugins: [
    customValidator({
      file: 'src/server/config-schema.ts',
      validator: function (module) {
        module.validateConfigSchema(process.env);
      },
    }),
  ],
});

Package Sidebar

Install

npm i @kevbook/vite-plugin-custom-validator

Weekly Downloads

0

Version

0.0.2

License

none

Unpacked Size

5.32 kB

Total Files

6

Last publish

Collaborators

  • kevbook