From 6ac25743bd7271ae5ddb393c1fbe879f936ca0c8 Mon Sep 17 00:00:00 2001 From: Artemiy Schukin Date: Wed, 15 Jun 2022 20:12:51 +0300 Subject: [PATCH] chore: unite css & content before replacements --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 8005dd9..4be5d91 100644 --- a/src/index.ts +++ b/src/index.ts @@ -78,13 +78,14 @@ export const buildSvgDataURI: BuildSvgDataURI = async (node, options) => { const base64Resources = await useFetcher(uniqueResources, options.fetcher) + content = `${content}` + for (const [url, base64] of base64Resources) { - css = css.replaceAll(url, base64) content = content.replaceAll(url, base64) } } - const svg = `${content}` + const svg = `${content}` const dataURI = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`