From 77dad04f9d8ff51da616a5c1487c646ce6749b29 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 22 Jun 2020 15:48:15 -0400 Subject: [PATCH] fix: should not emit assets that are inlined --- src/node/build/buildPluginAsset.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node/build/buildPluginAsset.ts b/src/node/build/buildPluginAsset.ts index 5da8db60c6d2af..5780e98481d5f4 100644 --- a/src/node/build/buildPluginAsset.ts +++ b/src/node/build/buildPluginAsset.ts @@ -59,9 +59,10 @@ export const resolveAsset = async ( const resolvedFileName = `${baseName}.${hash_sum(id)}${ext}` let url = slash(path.join(publicBase, assetsDir, resolvedFileName)) - const content = await fs.readFile(id) + let content: Buffer | undefined = await fs.readFile(id) if (!id.endsWith(`.svg`) && content.length < Number(inlineLimit)) { url = `data:${mime.lookup(id)};base64,${content.toString('base64')}` + content = undefined } resolved = {