Skip to content

Commit

Permalink
fix(@formatjs/intl-displaynames): add d.ts for locale files, fix #2850
Browse files Browse the repository at this point in the history
  • Loading branch information
longlho committed May 2, 2021
1 parent c9e56b8 commit d5a492a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/intl-displaynames/scripts/cldr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ function main(args: minimist.ParsedArgs) {
// Dist all locale files to locale-data (JS)
for (const locale of locales) {
const data = readFileSync(join(cldrFolder, `${locale}.json`))
const destFile = join(outDir, locale + '.js')
outputFileSync(
destFile,
join(outDir, locale + '.js'),
`/* @generated */
// prettier-ignore
if (Intl.DisplayNames && typeof Intl.DisplayNames.__addLocaleData === 'function') {
Intl.DisplayNames.__addLocaleData(${data})
}`
)
outputFileSync(join(outDir, locale + '.d.ts'), 'export {}')
}
}

Expand Down

0 comments on commit d5a492a

Please sign in to comment.