38 lines
987 B
TypeScript
38 lines
987 B
TypeScript
/// <reference types="vite-plugin-pwa/client" />
|
|
|
|
import { createInertiaApp } from '@inertiajs/vue3';
|
|
import { registerSW } from 'virtual:pwa-register';
|
|
import { createApp, h } from 'vue';
|
|
import 'vue-sonner/style.css';
|
|
import { Toaster } from '@/components/ui/sonner';
|
|
import { useFlashToast } from '@/composables/useFlashToast';
|
|
import { restoreConnection } from '@/lib/thermal-printer/stable-transport';
|
|
|
|
registerSW({ immediate: true });
|
|
void restoreConnection();
|
|
|
|
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
|
|
|
|
createInertiaApp({
|
|
title: (title) => (title ? `${title} - ${appName}` : appName),
|
|
progress: {
|
|
color: '#4B5563',
|
|
},
|
|
setup({ el, App, props, plugin }) {
|
|
if (!el) {
|
|
return;
|
|
}
|
|
|
|
const app = createApp({
|
|
setup() {
|
|
useFlashToast();
|
|
|
|
return () => [h(App, props), h(Toaster)];
|
|
},
|
|
});
|
|
|
|
app.use(plugin);
|
|
app.mount(el);
|
|
},
|
|
});
|