]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
workflow(sfc-playground): attach filename
authorEvan You <yyx990803@gmail.com>
Mon, 29 Mar 2021 04:32:28 +0000 (00:32 -0400)
committerEvan You <yyx990803@gmail.com>
Mon, 29 Mar 2021 04:32:28 +0000 (00:32 -0400)
packages/sfc-playground/src/store.ts

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