Skip to content

Commit 21c6194

Browse files
committed
feat: expose vite options
1 parent 0673f9d commit 21c6194

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

.changeset/ten-candles-stick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/vite-plugin": patch
3+
---
4+
5+
**api**: expose `vite` options

packages/vite-plugin/src/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
import { createClient } from '@hey-api/openapi-ts';
2+
import type { Plugin } from 'vite';
23

34
export function heyApiPlugin(options?: {
45
/**
56
* `@hey-api/openapi-ts` configuration options.
67
*/
78
config?: Parameters<typeof createClient>[0];
9+
/**
10+
* Vite plugin API options.
11+
*/
12+
vite?: Omit<Plugin, 'configResolved' | 'name'>;
813
}) {
914
return {
15+
enforce: 'pre',
16+
...options?.vite,
1017
configResolved: async () => {
1118
await createClient(options?.config);
1219
},
13-
enforce: 'pre',
1420
name: 'hey-api-plugin',
1521
};
1622
}

0 commit comments

Comments
 (0)