From 9949f0046114fdbb59062ecc044aa0a735733e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=83=BD=E5=AE=81?= Date: Sat, 15 Jul 2023 03:35:05 +0800 Subject: [PATCH] fix(build): cannot handle file name containing single quote (#2615) --- src/node/markdownToVue.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/node/markdownToVue.ts b/src/node/markdownToVue.ts index f8edcbd4..7559cb11 100644 --- a/src/node/markdownToVue.ts +++ b/src/node/markdownToVue.ts @@ -322,14 +322,16 @@ function injectPageDataCode( code + (hasDefaultExport ? `` - : `\nexport default {name:'${data.relativePath}'}`) + + : `\nexport default {name:${JSON.stringify(data.relativePath)}}`) + `` ) } else { tags.unshift( - `` + )}}` ) }