48 lines
1.0 KiB
TypeScript
48 lines
1.0 KiB
TypeScript
import * as Sentry from "@sentry/vue";
|
|
import * as log from "loglevel";
|
|
import { createPinia } from "pinia";
|
|
import { createApp, markRaw } from "vue";
|
|
|
|
import App from "./App.vue";
|
|
import { loadLocaleMessages, setupI18n } from "./i18n";
|
|
import router from "./router";
|
|
|
|
import type { Router } from "vue-router";
|
|
import "../tailwind.css";
|
|
|
|
declare module "pinia" {
|
|
export interface PiniaCustomProperties {
|
|
router: Router;
|
|
}
|
|
}
|
|
|
|
if (window.location.href.indexOf("localhost") >= 0) {
|
|
log.setLevel("trace");
|
|
} else {
|
|
log.setLevel("warn");
|
|
}
|
|
|
|
const i18n = setupI18n();
|
|
const app = createApp(App);
|
|
|
|
Sentry.init({
|
|
app,
|
|
environment: import.meta.env.VITE_SENTRY_ENV,
|
|
dsn: "https://2df6096a4fd94bd6b4802124d10e4b8d@o8544.ingest.sentry.io/4504157846372352",
|
|
tracesSampleRate: 0.0,
|
|
});
|
|
|
|
// todo: define lang setup
|
|
loadLocaleMessages(i18n, "de").then(() => {
|
|
app.use(router);
|
|
|
|
const pinia = createPinia();
|
|
pinia.use(({ store }) => {
|
|
store.router = markRaw(router);
|
|
});
|
|
app.use(pinia);
|
|
app.use(i18n);
|
|
|
|
app.mount("#app");
|
|
});
|