We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a6a16ee commit 9718146Copy full SHA for 9718146
1 file changed
src/composables/store.ts
@@ -1,10 +1,11 @@
1
import {
2
- compileFile,
+ compileFile as originalCompileFile,
3
File,
4
mergeImportMap,
5
useStore as useReplStore,
6
type ImportMap,
7
type StoreState,
8
+ type ReplStore,
9
} from '@vue/repl'
10
import { objectOmit } from '@vueuse/core'
11
import { IS_DEV } from '@/constants'
@@ -248,6 +249,17 @@ export const useStore = (initial: Initial) => {
248
249
break
250
}
251
252
+ async function compileFile(store: ReplStore, file: File) {
253
+ const errs = await originalCompileFile(store, file)
254
+ if (userOptions.vueVersion?.startsWith('3.2')) {
255
+ file.compiled.js = file.compiled.js.replace(
256
+ /export default (?!__sfc__)/,
257
+ 'const __sfc__ = ',
258
+ )
259
+ }
260
+
261
+ return errs
262
263
264
const resetFiles = () => {
265
const { files, addFile } = store
0 commit comments