Skip to content

tgandrews/vite-plugin-ts-gql

Repository files navigation

vite-plugin-ts-gql

A Vite plugin for running ts-gql in dev

This will automatically start the @ts-gql/compiler watch command so you don't have to and can just start vite.

Usage

  1. Install and set up vite and ts-gql
  2. Install the plugin npm i --save-dev vite-plugin-ts-gql or yarn add -D vite-plugin-ts-gql
  3. Import the plugin into your vite config vite.config.{ts,js} adding it the plugins.
import { vitePluginTsGql } from "vite-plugin-ts-gql";
export default defineConfig({
  // Rest of the config
  plugins: [vitePluginTsGql() /* rest of the plugins */],
});