main.ts 846 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { createApp } from 'vue';
  2. import urql, { createClient } from '@urql/vue';
  3. import App from './App.vue';
  4. // STYLES
  5. import 'virtual:windi.css';
  6. import '@hoppscotch/ui/style.css';
  7. import '../assets/scss/themes.scss';
  8. import '../assets/scss/styles.scss';
  9. // END STYLES
  10. import { HOPP_MODULES } from './modules';
  11. import { auth } from './helpers/auth';
  12. // Top-level await is not available in our targets
  13. (async () => {
  14. const app = createApp(App).use(
  15. urql,
  16. createClient({
  17. url: import.meta.env.VITE_BACKEND_GQL_URL,
  18. requestPolicy: 'network-only',
  19. fetchOptions: () => {
  20. return {
  21. credentials: 'include',
  22. };
  23. },
  24. })
  25. );
  26. // Initialize auth
  27. await auth.performAuthInit();
  28. // Initialize modules
  29. HOPP_MODULES.forEach((mod) => mod.onVueAppInit?.(app));
  30. app.mount('#app');
  31. })();