return`const __app__=createApp().app;__app__._component.mpType='app';__app__._component.render=()=>{};__app__.use(uni.__vuePlugin).mount("#app");${code.replace('createSSRApp','createVueApp as createSSRApp')}`;
return`import { plugin as __plugin } from '@dcloudio/uni-h5';createApp().app.use(__plugin).mount("#app");${code.replace('createSSRApp','createVueApp as createSSRApp')}`;
}
functioncreateLegacyApp(code){
return`import { plugin as __plugin } from '@dcloudio/uni-h5';function createApp(rootComponent,rootProps){return createVueApp(rootComponent, rootProps).use(__plugin)};${code.replace('createApp','createVueApp')}`;
}
functioncreateSSRClientApp(code){
return`import { plugin as __plugin } from '@dcloudio/uni-h5';import { UNI_SSR, UNI_SSR_STORE } from '@dcloudio/uni-shared';const { app: __app, store: __store } = createApp();__app.use(__plugin);__store && window[UNI_SSR] && window[UNI_SSR][UNI_SSR_STORE] && __store.replaceState(window[UNI_SSR][UNI_SSR_STORE]);__app.router.isReady().then(() => __app.mount("#app"));${code}`;