48 lines
1.6 KiB
TypeScript
48 lines
1.6 KiB
TypeScript
import { createInertiaApp } from '@inertiajs/vue3';
|
|
import { VueUmamiPlugin } from '@jaseeey/vue-umami-plugin';
|
|
import { configureEcho } from '@laravel/echo-vue';
|
|
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
|
|
import type { DefineComponent } from 'vue';
|
|
import { createApp, h } from 'vue';
|
|
import '../css/app.css';
|
|
import { initializeTheme } from '@/composables/useAppearance';
|
|
|
|
configureEcho({
|
|
broadcaster: 'reverb',
|
|
});
|
|
|
|
const appName = import.meta.env.VITE_APP_NAME || 'Perceptron Trainer';
|
|
|
|
createInertiaApp({
|
|
title: (title) => (title ? `${title} - ${appName}` : appName),
|
|
resolve: (name) =>
|
|
resolvePageComponent(
|
|
`./pages/${name}.vue`,
|
|
import.meta.glob<DefineComponent>('./pages/**/*.vue'),
|
|
),
|
|
setup({ el, App, props, plugin }) {
|
|
createApp({ render: () => h(App, props) })
|
|
.use(plugin)
|
|
.use(
|
|
VueUmamiPlugin({
|
|
websiteID: 'e616767f-e0d3-4ce9-b551-33c7c3806fc0',
|
|
scriptSrc: 'https://abcd.matthiasg.dev/script.js',
|
|
// autoTrack: true,
|
|
debug: import.meta.env.DEV,
|
|
extraDataAttributes: {
|
|
'data-auto-track': 'true',
|
|
'data-performance': 'true',
|
|
'data-domains': 'perceptron.matthiasg.dev,matthiasg.dev,www.matthiasg.dev',
|
|
}
|
|
}),
|
|
)
|
|
.mount(el);
|
|
},
|
|
progress: {
|
|
color: '#4B5563',
|
|
},
|
|
});
|
|
|
|
// This will set light / dark mode on page load...
|
|
initializeTheme();
|