Skip to content

Commit

Permalink
fix: avoid referencing importGlob from importMeta.d.ts (#6531)
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed Jan 16, 2022
1 parent d303264 commit 962d285
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/vite/types/importMeta.d.ts
Expand Up @@ -4,6 +4,15 @@

/* eslint-disable @typescript-eslint/consistent-type-imports */

// Duplicate import('../src/node/importGlob').AssertOptions
// Avoid breaking the production client type because this file is referenced
// in vite/client.d.ts and in production src/node/importGlob.ts doesn't exist
interface AssertOptions {
assert?: {
type: string
}
}

interface ImportMeta {
url: string

Expand Down Expand Up @@ -52,7 +61,7 @@ interface ImportMeta {

glob(
pattern: string,
options?: import('../src/node/importGlob').AssertOptions
options?: AssertOptions
): Record<
string,
() => Promise<{
Expand All @@ -62,7 +71,7 @@ interface ImportMeta {

globEager(
pattern: string,
options?: import('../src/node/importGlob').AssertOptions
options?: AssertOptions
): Record<
string,
{
Expand Down

0 comments on commit 962d285

Please sign in to comment.