workflow(sfc-playground): attach filename

This commit is contained in:
Evan You 2021-03-29 00:32:28 -04:00
parent ce5e0b67a9
commit bb937e9033

View File

@ -187,6 +187,7 @@ async function compileFile({ filename, code, compiled }: File) {
} }
if (finalCode) { if (finalCode) {
finalCode += `\n${COMP_IDENTIFIER}.__file = ${JSON.stringify(filename)}`
finalCode += `\nexport default ${COMP_IDENTIFIER}` finalCode += `\nexport default ${COMP_IDENTIFIER}`
compiled.js = finalCode.trimStart() compiled.js = finalCode.trimStart()
} }