File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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+ }
You can’t perform that action at this time.
0 commit comments