build(#10336): use unpkg for storybook twemojis
This commit is contained in:
parent
3f4d93a287
commit
edeabac8f7
@ -10,7 +10,7 @@ export const onUnhandledRequest = ((req, print) => {
|
|||||||
export const commonHandlers = [
|
export const commonHandlers = [
|
||||||
rest.get('/twemoji/:codepoints.svg', async (req, res, ctx) => {
|
rest.get('/twemoji/:codepoints.svg', async (req, res, ctx) => {
|
||||||
const { codepoints } = req.params;
|
const { codepoints } = req.params;
|
||||||
const file = await import(`../node_modules/@discordapp/twemoji/dist/svg/${codepoints}.svg?raw`);
|
const value = await fetch(`https://unpkg.com/@discordapp/twemoji@14.1.2/dist/svg/${codepoints}.svg`).then((response) => response.blob());
|
||||||
return res(ctx.set('Content-Type', 'image/svg+xml'), ctx.body(file.default));
|
return res(ctx.set('Content-Type', 'image/svg+xml'), ctx.body(value));
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user