Skip to content

Commit 74a1b12

Browse files
8ctavioantfu
andauthored
fix(presets): prevent resolvePreset from omitting typeFrom (#471)
Co-authored-by: Anthony Fu <github@antfu.me>
1 parent cd442b7 commit 74a1b12

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/preset.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ const commonProps: (keyof ImportCommon)[] = [
1212
'priority',
1313
'disabled',
1414
'dtsDisabled',
15+
'declarationType',
1516
'meta',
1617
'type',
18+
'typeFrom',
1719
]
1820

1921
export async function resolvePreset(preset: Preset): Promise<Import[]> {

test/dts.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ it('dts', async () => {
4545
},
4646
],
4747
},
48+
{
49+
from: 'pkg/src',
50+
typeFrom: 'pkg/dts',
51+
imports: ['pkg'],
52+
},
4853
],
4954
dirs: [
5055
'./playground/composables/**',
@@ -81,6 +86,7 @@ it('dts', async () => {
8186
const myfunc2: typeof import('<root>/playground/composables/nested/bar/named')['myfunc2']
8287
const named: typeof import('<root>/playground/composables/nested/bar/index')['named']
8388
const nested: typeof import('<root>/playground/composables/nested/index')['default']
89+
const pkg: typeof import('pkg/dts')['pkg']
8490
const reactive: typeof import('vue')['reactive']
8591
const ref: typeof import('vue')['ref']
8692
const subFoo: typeof import('<root>/playground/composables/nested/bar/sub/index')['subFoo']

0 commit comments

Comments
 (0)