File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 11import {
2- compileFile ,
2+ compileFile as originalCompileFile ,
33 File ,
44 mergeImportMap ,
55 useStore as useReplStore ,
66 type ImportMap ,
77 type StoreState ,
8+ type ReplStore ,
89} from '@vue/repl'
910import { objectOmit } from '@vueuse/core'
1011import { IS_DEV } from '@/constants'
@@ -248,6 +249,17 @@ export const useStore = (initial: Initial) => {
248249 break
249250 }
250251 }
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+ / e x p o r t d e f a u l t (? ! _ _ s f c _ _ ) / ,
257+ 'const __sfc__ = ' ,
258+ )
259+ }
260+
261+ return errs
262+ }
251263
252264 const resetFiles = ( ) => {
253265 const { files, addFile } = store
You can’t perform that action at this time.
0 commit comments