File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -22,14 +22,7 @@ export function run() {
2222 ) {
2323 const writeFile = options . host ! . writeFile . bind ( options . host ) ;
2424 options . host ! . writeFile = ( fileName , contents , ...args ) => {
25- if (
26- fileName . endsWith ( '.d.ts' )
27- && vueLanguagePlugin
28- . getCanonicalFileName ( fileName . replace ( windowsPathReg , '/' ) )
29- . slice ( 0 , - 5 ) === vueLanguagePlugin . pluginContext . globalTypesHolder
30- ) {
31- contents = removeEmitGlobalTypes ( contents ) ;
32- }
25+ contents = removeEmitGlobalTypes ( contents ) ;
3326 return writeFile ( fileName , contents , ...args ) ;
3427 } ;
3528 const vueLanguagePlugin = vue . createVueLanguagePlugin (
@@ -66,6 +59,8 @@ export function run() {
6659 }
6760}
6861
62+ const removeEmitGlobalTypesRegexp = / [ ^ \n ] * _ _ V L S _ g l o b a l T y p e s S t a r t [ \w \W ] * _ _ V L S _ g l o b a l T y p e s E n d [ ^ \n ] * \n / g;
63+
6964export function removeEmitGlobalTypes ( dts : string ) {
70- return dts . replace ( / [ ^ \n ] * _ _ V L S _ g l o b a l T y p e s S t a r t [ \w \W ] * _ _ V L S _ g l o b a l T y p e s E n d [ ^ \n ] * \n / , '' ) ;
65+ return dts . replace ( removeEmitGlobalTypesRegexp , '' ) ;
7166}
You can’t perform that action at this time.
0 commit comments