Skip to content

Commit b3c271e

Browse files
committed
fix: compatible with jiti
1 parent fce521e commit b3c271e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/vite-plugin-checker/src/logger.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import fs from 'fs'
33
import { createRequire } from 'module'
44
import os from 'os'
55
import strip from 'strip-ansi'
6-
import vscodeUri from 'vscode-uri'
6+
import * as _vscodeUri from 'vscode-uri'
7+
8+
// hack to compatible with Jiti
9+
// see details: https://github.com/fi3ework/vite-plugin-checker/issues/197
10+
// @ts-expect-error
11+
const URI = _vscodeUri?.default?.URI ?? _vscodeUri.URI
712
import { parentPort } from 'worker_threads'
813

914
import { codeFrameColumns, SourceLocation } from '@babel/code-frame'
@@ -32,7 +37,6 @@ import type {
3237
LineAndCharacter,
3338
} from 'typescript'
3439

35-
const { URI } = vscodeUri
3640
export interface NormalizedDiagnostic {
3741
/** error message */
3842
message?: string

0 commit comments

Comments
 (0)