diff --git a/packages/sfc-playground/package.json b/packages/sfc-playground/package.json index 2cad1619c66..713a6ac74ca 100644 --- a/packages/sfc-playground/package.json +++ b/packages/sfc-playground/package.json @@ -22,6 +22,7 @@ }, "dependencies": { "file-saver": "^2.0.5", - "jszip": "^3.6.0" + "jszip": "^3.6.0", + "sucrase": "^3.19.0" } } diff --git a/packages/sfc-playground/src/sfcCompiler.ts b/packages/sfc-playground/src/sfcCompiler.ts index 43e7d9facba..8fe74f9ecc1 100644 --- a/packages/sfc-playground/src/sfcCompiler.ts +++ b/packages/sfc-playground/src/sfcCompiler.ts @@ -59,17 +59,24 @@ export async function compileFile({ filename, code, compiled }: File) { } if ( - (descriptor.script && descriptor.script.lang) || - (descriptor.scriptSetup && descriptor.scriptSetup.lang) || descriptor.styles.some(s => s.lang) || (descriptor.template && descriptor.template.lang) ) { store.errors = [ - 'lang="x" pre-processors are not supported in the in-browser playground.' + `lang="x" pre-processors for