From d9db386dc2a940a73d95548de4c3d7d1fb411668 Mon Sep 17 00:00:00 2001 From: hemengke1997 <23536175@qq.com> Date: Wed, 20 Sep 2023 18:16:57 +0800 Subject: [PATCH] fix: script attributes maybe falsy --- playground/spa/src/App.tsx | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/playground/spa/src/App.tsx b/playground/spa/src/App.tsx index f5efcfd..996542c 100644 --- a/playground/spa/src/App.tsx +++ b/playground/spa/src/App.tsx @@ -11,7 +11,7 @@ function App() {
- Vite logo + Vite logo React logo diff --git a/src/index.ts b/src/index.ts index 7b9b2b8..5239f71 100644 --- a/src/index.ts +++ b/src/index.ts @@ -296,7 +296,7 @@ export default function publicTypescript(options: VPPTPluginOptions = {}) { acc += ` ${attr.name}="${cacheItem!.path}"` return acc } - acc += ` ${attr.name}="${attr.value}"` + acc += attr.value ? ` ${attr.name}="${attr.value}"` : ` ${attr.name}` return acc }, '') .trim()