@@ -8,16 +8,15 @@ export const rebuildDist = async (
88 classNames : string [ ] ,
99) => {
1010 const distDir = path . join ( root , 'dist' ) ;
11- const backupDir = path . join ( root , 'backup' ) ;
1211
1312 {
14- let backupDTS = await readFile ( path . join ( backupDir , 'index.d.ts' ) , 'utf8' ) ;
13+ let backupDTS = await readFile ( path . join ( distDir , 'backup- index.d.ts' ) , 'utf8' ) ;
1514 backupDTS += `\n${ dtsContent } \nexport { ${ classNames . join ( ', ' ) } };` ;
1615 await writeFile ( path . join ( distDir , 'index.d.ts' ) , backupDTS ) ;
1716 }
1817
1918 {
20- let backupCJS = await readFile ( path . join ( backupDir , 'index.js' ) , 'utf8' ) ;
19+ let backupCJS = await readFile ( path . join ( distDir , 'backup- index.js' ) , 'utf8' ) ;
2120 backupCJS = backupCJS . replace (
2221 '0 && (module.exports = {' ,
2322 `${ jsContent } \n0 && (module.exports = {\n${ classNames . join ( ',' ) } ,` ,
@@ -30,7 +29,7 @@ export const rebuildDist = async (
3029 }
3130
3231 {
33- let backupESM = await readFile ( path . join ( backupDir , 'esm' , 'index.js' ) , 'utf8' ) ;
32+ let backupESM = await readFile ( path . join ( distDir , 'esm' , 'backup- index.js' ) , 'utf8' ) ;
3433 backupESM += `\n${ jsContent } \nexport { ${ classNames . join ( ', ' ) } };` ;
3534 await writeFile ( path . join ( distDir , 'esm' , 'index.js' ) , backupESM ) ;
3635 }
0 commit comments