Skip to content

Commit

Permalink
Type vite config (#786)
Browse files Browse the repository at this point in the history
  • Loading branch information
furudean authored Mar 31, 2021
1 parent 96cbda3 commit b8a8e53
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/seven-jars-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

Add type to config.kit.vite
3 changes: 2 additions & 1 deletion packages/kit/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Headers, LoadInput, LoadOutput, Logger } from './types.internal';
import { UserConfig as ViteConfig } from 'vite';

export type Config = {
compilerOptions?: any;
Expand Down Expand Up @@ -31,7 +32,7 @@ export type Config = {
router?: boolean;
ssr?: boolean;
target?: string;
vite?: {} | (() => {});
vite?: ViteConfig | (() => ViteConfig);
};
preprocess?: any;
};
Expand Down
3 changes: 2 additions & 1 deletion packages/kit/types.internal.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Adapter, GetContext, GetSession, Handle, Incoming, Load, Response } from './types';
import { UserConfig as ViteConfig } from 'vite';

declare global {
interface ImportMeta {
Expand Down Expand Up @@ -47,7 +48,7 @@ export type ValidatedConfig = {
router: boolean;
ssr: boolean;
target: string;
vite: () => {};
vite: () => ViteConfig;
};
preprocess: any;
};
Expand Down

0 comments on commit b8a8e53

Please sign in to comment.