Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/vue-tsc/bin/vue-tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ fs.readFileSync = (...args) => {
tryReplace(/supportedJSExtensions = .*(?=;)/, s => s + '.concat([[".vue"]])');
tryReplace(/allSupportedExtensions = .*(?=;)/, s => s + '.concat([[".vue"]])');

// proxy startTracing, dumpTracingLegend
tryReplace(/ = tracingEnabled\./g, ` = require(${JSON.stringify(proxyApiPath)}).loadTsLib().`);

// proxy createProgram apis
tryReplace(/function createProgram\(.+\) {/, s => s + ` return require(${JSON.stringify(proxyApiPath)}).createProgram(...arguments);`);

Expand Down
7 changes: 3 additions & 4 deletions packages/vue-tsc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export function createProgram(options: ts.CreateProgramOptions) {
if (!options.options.noEmit && options.options.noEmitOnError)
throw toThrow('noEmitOnError is not supported');

if (options.options.extendedDiagnostics || options.options.generateTrace)
throw toThrow('--extendedDiagnostics / --generateTrace is not supported, please run `Write Virtual Files` in VSCode to write virtual files and use `--extendedDiagnostics` / `--generateTrace` via tsc instead of vue-tsc to debug.');

if (!options.host)
throw toThrow('!options.host');

Expand Down Expand Up @@ -153,10 +156,6 @@ export function createProgram(options: ts.CreateProgramOptions) {
return program;
}

export function loadTsLib() {
return ts;
}

function toThrow(msg: string) {
console.error(msg);
return msg;
Expand Down