diff --git a/packages/sfc-playground/src/store.ts b/packages/sfc-playground/src/store.ts index 2328d52af..05f6f5fce 100644 --- a/packages/sfc-playground/src/store.ts +++ b/packages/sfc-playground/src/store.ts @@ -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() }