From 3a1f2c60633b586d9701e819161bbb31acd93335 Mon Sep 17 00:00:00 2001 From: Paul Wright Date: Sat, 20 Mar 2021 12:16:48 -0400 Subject: [PATCH] Fix unexpected token error --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 4996737..513081e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,7 +9,7 @@ export function viteSingleFile(): Plugin { enforce: "post", transform(html: string, ctx?: IndexHtmlTransformContext): IndexHtmlTransformResult { // Only use this plugin during build - if (!ctx?.bundle) return html + if (!ctx || !ctx.bundle) return html // Get the bundle let extraCode = "" for (const [, value] of Object.entries(ctx.bundle)) {