File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -71,22 +71,21 @@ export const vueLoader: Loader = async (input, mkdistContext) => {
71
71
} )
72
72
73
73
// generate dts
74
- const dts = [
75
- {
76
- contents : 'export default {}' ,
77
- path : `${ input . path } .js` ,
78
- srcPath : `${ input . srcPath } .js` ,
79
- extension : '.d.ts' ,
80
- declaration : true ,
81
- } ,
82
- {
74
+ const dts = ( await mkdistContext . loadFile ( {
75
+ path : `${ input . path } .js` ,
76
+ srcPath : `${ input . srcPath } .js` ,
77
+ extension : '.js' ,
78
+ getContents : ( ) => 'export default {}' ,
79
+ } ) ) ?. filter ( f => f . declaration ) || [ ]
80
+ if ( dts . length ) {
81
+ dts . push ( {
83
82
contents : await input . getContents ( ) ,
84
83
path : input . path ,
85
84
srcPath : input . srcPath ,
86
85
extension : '.d.vue.ts' ,
87
86
declaration : true ,
88
- } ,
89
- ]
87
+ } )
88
+ }
90
89
91
90
return [
92
91
{
You can’t perform that action at this time.
0 commit comments