@@ -2,16 +2,15 @@ import { run } from "@alanscodelog/utils/node"
2
2
import glob from "fast-glob"
3
3
import path from "path"
4
4
import type { PluginOption } from "vite"
5
- import dts from "vite-plugin-dts"
6
5
import { externalizeDeps } from "vite-plugin-externalize-deps"
7
6
import tsconfigPaths from "vite-tsconfig-paths"
8
7
import { defineConfig } from "vitest/config"
9
8
10
9
11
- const typesPlugin = ( { fixOnly } : { fixOnly : boolean } ) : PluginOption => ( {
10
+ const typesPlugin = ( ) : PluginOption => ( {
12
11
name : "typesPlugin" ,
13
12
// eslint-disable-next-line no-console
14
- writeBundle : async ( ) => run ( `npm run build:types${ fixOnly ? ":fix" : "" } ` ) . promise . catch ( e => console . log ( e ) ) . then ( ( ) => undefined ) ,
13
+ writeBundle : async ( ) => run ( `npm run build:types` ) . promise . catch ( e => console . log ( e ) ) . then ( ( ) => undefined ) ,
15
14
} )
16
15
17
16
// https://vitejs.dev/config/
@@ -21,15 +20,8 @@ export default async ({ mode }: { mode: string }) => defineConfig({
21
20
externalizeDeps ( ) ,
22
21
// even if we don't use aliases, this is needed to get imports based on baseUrl working
23
22
tsconfigPaths ( ) ,
24
- // generates types for ts/vue files
25
- // if only using ts, can be removed and build:types script used instead
26
- dts ( {
27
- entryRoot : "src" ,
28
- tsconfigPath : "./tsconfig.types.json" ,
29
- } ) ,
30
- // fixes alias and baseUrl imports in the generated types
31
- // cannot be removed because dts is not compatible with tsconfigPaths
32
- typesPlugin ( { fixOnly : true } ) ,
23
+ // runs build:types script which takes care of generating types and fixing type aliases and baseUrl imports
24
+ typesPlugin ( ) ,
33
25
] ,
34
26
build : {
35
27
outDir : "dist" ,
0 commit comments