Skip to content

Commit

Permalink
fix: compatible with jiti
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Jan 25, 2023
1 parent fce521e commit b3c271e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/vite-plugin-checker/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import fs from 'fs'
import { createRequire } from 'module'
import os from 'os'
import strip from 'strip-ansi'
import vscodeUri from 'vscode-uri'
import * as _vscodeUri from 'vscode-uri'

// hack to compatible with Jiti
// see details: https://github.com/fi3ework/vite-plugin-checker/issues/197
// @ts-expect-error
const URI = _vscodeUri?.default?.URI ?? _vscodeUri.URI
import { parentPort } from 'worker_threads'

import { codeFrameColumns, SourceLocation } from '@babel/code-frame'
Expand Down Expand Up @@ -32,7 +37,6 @@ import type {
LineAndCharacter,
} from 'typescript'

const { URI } = vscodeUri
export interface NormalizedDiagnostic {
/** error message */
message?: string
Expand Down

0 comments on commit b3c271e

Please sign in to comment.