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) => {
36
36
configFilePath . replace ( windowsPathReg , '/' ) ,
37
37
) . vueOptions
38
38
: 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
+ }
43
48
}
44
49
const vueLanguagePlugin = vue . createVueLanguagePlugin (
45
50
ts ,
You can’t perform that action at this time.
0 commit comments