Skip to content

EdieLemoine/vite-plugin-custom-tsconfig

Repository files navigation

vite-plugin-custom-tsconfig

NPM

A very simple plugin to support using filenames like tsconfig.build.json or tsconfig.app.json with Vite. It copies your tsconfig.*.json to tsconfig.json before Vite starts, and removes it when the build is finished.

Installation

Using Yarn

yarn add -D vite-plugin-custom-tsconfig

Using pnpm

pnpm add -D vite-plugin-custom-tsconfig

Using npm

npm install --save-dev vite-plugin-custom-tsconfig

Usage

// vite.config.ts
import customTsConfig from 'vite-plugin-custom-tsconfig';
import {defineConfig} from 'vite';

export default defineConfig({
  plugins: [
    customTsConfig({
      // default: 'tsconfig.build.json'
      tsConfigPath: 'tsconfig.app.json',
    }),
  ],
});