UNPKG

vite-esbuild-typescript-checker

Version:

* Speeds up [TypeScript](https://github.com/Microsoft/TypeScript) type checking * Supports [Vue Single File Component](https://vuejs.org/v2/guide/single-file-components.html) * Displays nice error messages with the [code frame](https://babeljs.io/docs/en/

19 lines (18 loc) 769 B
import ts from 'typescript'; import { getSystem } from '../system'; import { getVueExtension } from '../vue/type-script-vue-extension'; export function createCompilerHost(parsedConfig) { const baseCompilerHost = ts.createCompilerHost(parsedConfig.options); const typescriptVueExtension = getVueExtension(); const system = getSystem(); let controlledCompilerHost = { ...baseCompilerHost, fileExists: system.fileExists, readFile: system.readFile, directoryExists: system.directoryExists, getDirectories: system.getDirectories, realpath: system.realpath }; controlledCompilerHost = typescriptVueExtension.extendCompilerHost(controlledCompilerHost, parsedConfig); return controlledCompilerHost; }