fix(build): cannot handle file name containing single quote (#2615)

pull/2620/head
烽宁 1 year ago committed by GitHub
parent 5ffaa562fd
commit 9949f00461
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -322,14 +322,16 @@ function injectPageDataCode(
code +
(hasDefaultExport
? ``
: `\nexport default {name:'${data.relativePath}'}`) +
: `\nexport default {name:${JSON.stringify(data.relativePath)}}`) +
`</script>`
)
} else {
tags.unshift(
`<script ${isUsingTS ? 'lang="ts"' : ''}>${code}\nexport default {name:'${
`<script ${
isUsingTS ? 'lang="ts"' : ''
}>${code}\nexport default {name:${JSON.stringify(
data.relativePath
}'}</script>`
)}}</script>`
)
}

Loading…
Cancel
Save