Skip to content

Commit 626fd49

Browse files
timea-solidCopilot
andauthored
Update scripts/build-component-dts.mjs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 00d1cd7 commit 626fd49

1 file changed

Lines changed: 22 additions & 5 deletions

File tree

scripts/build-component-dts.mjs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,26 @@ import { mkdirSync, writeFileSync } from 'fs'
44
// from the tsc output under dist/v2/components/, keeping v2 internal and the
55
// public package layout clean.
66

7-
mkdirSync('dist/components/header', { recursive: true })
7+
const componentWrappers = [
8+
{
9+
outputDir: 'header',
10+
exportPath: '../../v2/components/header/index'
11+
},
12+
{
13+
outputDir: 'loginButton',
14+
exportPath: '../../v2/components/loginButton/index'
15+
},
16+
{
17+
outputDir: 'signupButton',
18+
exportPath: '../../v2/components/signupButton/index'
19+
}
20+
]
821

9-
writeFileSync(
10-
'dist/components/header/index.d.ts',
11-
"export * from '../../v2/components/header/index';\n"
12-
)
22+
for (const { outputDir, exportPath } of componentWrappers) {
23+
mkdirSync(`dist/components/${outputDir}`, { recursive: true })
24+
25+
writeFileSync(
26+
`dist/components/${outputDir}/index.d.ts`,
27+
`export * from '${exportPath}';\n`
28+
)
29+
}

0 commit comments

Comments
 (0)