mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Update dependency vite to v8 (#38174)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: ChaosExAnima <ChaosExAnima@users.noreply.github.com>
This commit is contained in:
@@ -51,13 +51,17 @@ export const mockHandlers = {
|
||||
'/packs-dev/emoji/:locale.json',
|
||||
async ({ params }) => {
|
||||
const locale = toSupportedLocale(params.locale);
|
||||
const key = `../../../../../node_modules/emojibase-data/${locale}/compact.json`;
|
||||
const emojiModules = import.meta.glob<CompactEmoji[]>(
|
||||
'../../../../../node_modules/emojibase-data/**/compact.json',
|
||||
{ import: 'default' },
|
||||
);
|
||||
const path = emojiModules[key];
|
||||
if (!path) {
|
||||
throw new Error(`Unsupported locale: ${locale}`);
|
||||
}
|
||||
action('fetching emoji data')(locale);
|
||||
const { default: data } = (await import(
|
||||
/* @vite-ignore */
|
||||
`emojibase-data/${locale}/compact.json`
|
||||
)) as {
|
||||
default: CompactEmoji[];
|
||||
};
|
||||
const data = await path();
|
||||
|
||||
return HttpResponse.json([data]);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user