mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-23 04:34:15 -04:00
23 lines
550 B
TypeScript
23 lines
550 B
TypeScript
import { defineNuxtPlugin } from 'nuxt/app';
|
|
import type { Router } from 'vue-router';
|
|
|
|
declare global {
|
|
interface Window {
|
|
__NUXT_ROUTES__: string[];
|
|
}
|
|
}
|
|
|
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
// Only expose routes in development
|
|
if (import.meta.env?.APP_ENV !== 'production') {
|
|
const router = nuxtApp.$router as Router;
|
|
const routes: string[] = [];
|
|
|
|
for (const route of router.getRoutes()) {
|
|
routes.push(route.path);
|
|
}
|
|
|
|
window.__NUXT_ROUTES__ = routes;
|
|
}
|
|
});
|