32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import * as Vue from 'vue';
|
|
import App from './App.vue';
|
|
import { api, boot } from './api';
|
|
import FormFields from './components/FormFields.vue';
|
|
import Icon from './components/Icon.vue';
|
|
import Link from './components/Link.vue';
|
|
import MediaPicker from './components/MediaPicker.vue';
|
|
import { setLocale, t } from './i18n';
|
|
import { flash, navigate, register, start } from './state';
|
|
import './style.css';
|
|
|
|
setLocale(boot.locale);
|
|
|
|
// What a site's own bundle (config `manager.extensions`) may use. Its `import 'vue'` is mapped to this very Vue (see
|
|
// resources/dist/vue.js), so its components share the reactivity of the screens.
|
|
(window as any).IriksManager = { Vue, boot, api, t, flash, navigate, register, components: { Link, FormFields, Icon, MediaPicker } };
|
|
|
|
async function run(): Promise<void> {
|
|
for (const url of boot.extensions ?? []) {
|
|
try {
|
|
await import(/* @vite-ignore */ url);
|
|
} catch (error) {
|
|
console.error(`Manager extension ${url} did not load`, error);
|
|
}
|
|
}
|
|
|
|
Vue.createApp(App).mount('#manager');
|
|
start();
|
|
}
|
|
|
|
void run();
|