@@ -58,7 +58,7 @@ const configs: Record<IBuildTargetFormat, { input: string; outputs: rollup.Outpu
5858 { file : `dist/commonjs/${ DIST_FILE_NAME } ` , format : 'cjs' } ,
5959 { file : `dist/amd/${ DIST_FILE_NAME } ` , format : 'amd' , amd : { id : LIB_NAME } } ,
6060 { file : `dist/native-modules/${ DIST_FILE_NAME } ` , format : 'esm' } ,
61- {
61+ {
6262 file : `dist/umd/${ DIST_FILE_NAME } ` ,
6363 format : 'umd' ,
6464 name : 'au.i18n' ,
@@ -168,7 +168,7 @@ if (args.dev) {
168168
169169async function generateDts ( ) : Promise < void > {
170170 console . log ( '\n==============\nGenerating dts bundle...\n==============' ) ;
171- return new Promise < void > ( ( resolve , reject ) => {
171+ return new Promise < void > ( resolve => {
172172 ChildProcess . exec ( `npm run build:dts` , ( err , stdout , stderr ) => {
173173 if ( err || stderr ) {
174174 console . log ( 'Generating dts error:' ) ;
@@ -177,26 +177,11 @@ async function generateDts(): Promise<void> {
177177 console . log ( 'Generated dts bundle successfully' ) ;
178178 console . log ( stdout ) ;
179179 }
180- try {
181- fixI18nDefaultImport ( path . resolve ( DIST_DIR , TYPE_DIST_FILE_NAME ) ) ;
182- } catch ( ex ) {
183- console . log ( 'Failure fixing default import.' ) ;
184- reject ( ex ) ;
185- }
186180 resolve ( ) ;
187181 } ) ;
188182 } ) ;
189183}
190184
191- async function fixI18nDefaultImport ( typeDefFileName : string ) {
192- const importDeclaration = `import i18next from 'i18next';` ;
193- const data = fs . readFileSync ( typeDefFileName , 'utf-8' )
194- . replace ( "import { i18next } from 'i18next';" , importDeclaration ) ;
195- const fd = fs . openSync ( typeDefFileName , 'w+' ) ;
196-
197- fs . writeSync ( fd , Buffer . from ( data , 'utf8' ) ) ;
198- }
199-
200185function copyToTargetProject ( targetFormats : string [ ] , targetProject : string ) {
201186 console . log ( '=============\nCopying to target\n=============' ) ;
202187 targetFormats . forEach ( ( targetFormat ) => {
0 commit comments