@@ -48,6 +48,56 @@ describe('runtime tests', () => {
4848 expect ( normalizePath ( alias ! . replacement ) ) . toBe ( normalizePath ( resolve ( tempDir , 'src/$1' ) ) )
4949 } )
5050
51+ it ( 'should include .vue files when using glob patterns with processor vue' , async ( ) => {
52+ tempDir = mkdtempSync ( resolve ( tmpdir ( ) , 'unplugin-dts-' ) )
53+
54+ writeFileSync (
55+ resolve ( tempDir , 'tsconfig.json' ) ,
56+ JSON . stringify ( {
57+ include : [ 'src/**/*' ] ,
58+ exclude : [ 'node_modules' , 'dist' ] ,
59+ compilerOptions : {
60+ target : 'ESNext' ,
61+ module : 'ESNext' ,
62+ composite : true ,
63+ moduleResolution : 'bundler' ,
64+ strict : true ,
65+ } ,
66+ } ) ,
67+ )
68+
69+ mkdirSync ( resolve ( tempDir , 'src' , 'components' ) , { recursive : true } )
70+ writeFileSync (
71+ resolve ( tempDir , 'src' , 'main.ts' ) ,
72+ `import App from './App.vue'\nexport { App }\n` ,
73+ )
74+ writeFileSync (
75+ resolve ( tempDir , 'src' , 'App.vue' ) ,
76+ `<template><HelloWorld /></template>\n<script setup lang="ts">\nimport HelloWorld from './components/HelloWorld.vue'\n</script>\n` ,
77+ )
78+ writeFileSync (
79+ resolve ( tempDir , 'src' , 'components' , 'HelloWorld.vue' ) ,
80+ `<template><div>Hello</div></template>\n<script setup lang="ts">\nconst msg = 'Hello World'\n</script>\n` ,
81+ )
82+
83+ const runtime = await Runtime . toInstance ( {
84+ processor : 'vue' ,
85+ root : tempDir ,
86+ tsconfigPath : 'tsconfig.json' ,
87+ entries : {
88+ main : resolve ( tempDir , 'src/main.ts' ) ,
89+ } ,
90+ } )
91+
92+ const diagnostics = runtime . getDiagnostics ( )
93+ const ts6307 = diagnostics . filter ( ( d : any ) => {
94+ const msg = typeof d . messageText === 'string' ? d . messageText : d . messageText . messageText
95+ return msg . includes ( 'not listed within the file list' )
96+ } )
97+
98+ expect ( ts6307 ) . toHaveLength ( 0 )
99+ } )
100+
51101 it ( 'should use baseUrl when explicitly set' , async ( ) => {
52102 tempDir = mkdtempSync ( resolve ( tmpdir ( ) , 'unplugin-dts-' ) )
53103
0 commit comments