File tree 3 files changed +26
-4
lines changed 3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change
1
+ <script lang="ts" setup></script >
2
+
3
+ <template >
4
+ <div >test</div >
5
+ </template >
6
+
7
+ <i18n lang="json">
8
+ {
9
+ "zh-cn" : {
10
+ "test" : " test"
11
+ },
12
+ "en" : {
13
+ "test" : " test"
14
+ }
15
+ }
16
+ </i18n >
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import NoDirectExport from '@/components/NoDirectExport.vue'
13
13
14
14
import OutsideTsProps from '@/components/outside-ts-props'
15
15
import GenericProps from '@/components/GenericProps.vue'
16
+ import CustomSFC from '@/components/CustomSFC.vue'
16
17
17
18
import JsSetup from '../components/JsSetup.vue'
18
19
import CssVar from '../components/CssVar.vue'
@@ -47,7 +48,8 @@ export {
47
48
JsSetup ,
48
49
CssVar ,
49
50
OutsideTsProps ,
50
- GenericProps
51
+ GenericProps ,
52
+ CustomSFC
51
53
}
52
54
53
55
export default DefaultImport
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ export function dtsPlugin(options: PluginOptions = {}): import('vite').Plugin {
120
120
121
121
const rootFiles = new Set < string > ( )
122
122
const outputFiles = new Map < string , string > ( )
123
+ const transformedFiles = new Set < string > ( )
123
124
124
125
const setOutputFile = ( path : string , content : string ) => {
125
126
outputFiles . set ( path , content )
@@ -394,22 +395,23 @@ export function dtsPlugin(options: PluginOptions = {}): import('vite').Plugin {
394
395
395
396
async transform ( code , id ) {
396
397
let resolver : Resolver | undefined
397
- id = normalizePath ( id )
398
+ id = normalizePath ( id ) . split ( '?' ) [ 0 ]
398
399
399
400
if (
400
401
! host ||
401
402
! program ||
402
403
! filter ( id ) ||
403
- ( ! ( resolver = resolvers . find ( r => r . supports ( id ) ) ) && ! tjsRE . test ( id ) )
404
+ ( ! ( resolver = resolvers . find ( r => r . supports ( id ) ) ) && ! tjsRE . test ( id ) ) ||
405
+ transformedFiles . has ( id )
404
406
) {
405
407
return
406
408
}
407
409
408
410
const startTime = Date . now ( )
409
411
const outDir = outDirs [ 0 ]
410
412
411
- id = id . split ( '?' ) [ 0 ]
412
413
rootFiles . delete ( id )
414
+ transformedFiles . add ( id )
413
415
414
416
if ( resolver ) {
415
417
const result = await resolver . transform ( {
@@ -487,6 +489,8 @@ export function dtsPlugin(options: PluginOptions = {}): import('vite').Plugin {
487
489
} ,
488
490
489
491
async writeBundle ( ) {
492
+ transformedFiles . clear ( )
493
+
490
494
if ( ! host || ! program || bundled ) return
491
495
492
496
bundled = true
You can’t perform that action at this time.
0 commit comments