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
12 changes: 12 additions & 0 deletions packages/vue-tsc/bin/vue-tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ fs.readFileSync = (...args) => {
`function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {`,
`function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) { return require(${JSON.stringify(proxyPath)}).createProgramProxy(...arguments);`,
);

// proxy tracing
tsc = tsc.replace(
`ts.startTracing = tracingEnabled.startTracing;`,
`ts.startTracing = require(${JSON.stringify(proxyPath)}).loadTsLib().startTracing;`,
);

tsc = tsc.replace(
`ts.dumpTracingLegend = tracingEnabled.dumpLegend;`,
`ts.dumpTracingLegend = require(${JSON.stringify(proxyPath)}).loadTsLib().dumpTracingLegend;`,
);

return tsc;
}
return readFileSync(...args);
Expand Down
4 changes: 4 additions & 0 deletions packages/vue-tsc/src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ export function createProgramProxy(
}
}

export function loadTsLib() {
return ts;
}

function doThrow(msg: string) {
console.error(msg);
throw msg;
Expand Down