fix date-fns dynamic import (#2716)

This commit is contained in:
matc-pub 2024-09-25 16:07:37 +02:00 committed by GitHub
parent 9ff0b93560
commit 626b18d478
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -136,7 +136,7 @@ function langToLocale(lang: string): DateFnsDesc | undefined {
async function load(locale: DateFnsDesc): Promise<Locale> {
return import(
/* webpackChunkName: `date-fns-[request]` */
`date-fns/locale/${locale.resource}.mjs`
`date-fns/locale/${locale.resource}.js`
).then(x => x.default);
}
@ -184,7 +184,7 @@ export function findDateFnsChunkNames(languages: readonly string[]): string[] {
if (locale.bundled) {
return [];
}
return [`date-fns-${locale.resource}-mjs`];
return [`date-fns-${locale.resource}-js`];
}
export default async function () {