File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
packages/vite-plugin-checker/src/checkers/vueTsc Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,15 @@ exports.getLanguagePlugins = (ts, options) => {
3636 configFilePath . replace ( windowsPathReg , '/' ) ,
3737 ) . vueOptions
3838 : getDefaultCompilerOptions ( )
39- const host = /** @type {import('typescript').CompilerHost } */ ( options . host )
40- const writeFile = host . writeFile . bind ( host )
41- host . writeFile = ( fileName , contents , ...args ) => {
42- return writeFile ( fileName , removeEmitGlobalTypes ( contents ) , ...args )
39+
40+ if ( vue . writeGlobalTypes ) {
41+ vue . writeGlobalTypes ( vueOptions , ts . sys . writeFile )
42+ } else {
43+ const host = /** @type {import('typescript').CompilerHost } */ ( options . host )
44+ const writeFile = host . writeFile . bind ( host )
45+ host . writeFile = ( fileName , contents , ...args ) => {
46+ return writeFile ( fileName , removeEmitGlobalTypes ( contents ) , ...args )
47+ }
4348 }
4449 const vueLanguagePlugin = vue . createVueLanguagePlugin (
4550 ts ,
You can’t perform that action at this time.
0 commit comments