Skip to content

Commit e4c3d4a

Browse files
committed
order imports to allow pkgs to init correctly
1 parent 2506e4b commit e4c3d4a

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

packages/platform-ui/src/main.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import ENV from './ENVIRONMENT_VARS';
2+
13
import 'roboto-fontface/css/roboto/roboto-fontface.css';
24
import { createApp } from 'vue';
35
import App from './App.vue';
@@ -6,21 +8,27 @@ import router from './router';
68
import { createPinia } from 'pinia';
79
import vuetify from './plugins/vuetify';
810
// common-ui imports
9-
import { piniaPlugin } from '@vue-skuilder/common-ui';
1011
import '@vue-skuilder/common-ui/style';
11-
// `courses` imports
12-
import Courses from '@vue-skuilder/courses';
12+
// `courses` imports - keep style import for initial page rendering
1313
import '@vue-skuilder/courses/style';
1414
// `db` import and initialization
1515
import { initializeDataLayer } from '@vue-skuilder/db';
1616

1717
(async () => {
1818
await initializeDataLayer({
1919
type: 'pouch',
20+
options: {
21+
COUCHDB_SERVER_PROTOCOL: ENV.COUCHDB_SERVER_PROTOCOL,
22+
COUCHDB_SERVER_URL: ENV.COUCHDB_SERVER_URL,
23+
},
2024
});
25+
2126
const pinia = createPinia();
2227
const app = createApp(App);
2328

29+
// Dynamically import Courses
30+
const { default: Courses } = await import('@vue-skuilder/courses');
31+
2432
// Register all view components globally
2533
const viewComponents = Courses.allViewsRaw();
2634
Object.entries(viewComponents).forEach(([name, component]) => {
@@ -30,6 +38,10 @@ import { initializeDataLayer } from '@vue-skuilder/db';
3038
app.use(router);
3139
app.use(vuetify);
3240
app.use(pinia);
41+
42+
// Dynamically import piniaPlugin
43+
const { piniaPlugin } = await import('@vue-skuilder/common-ui');
3344
app.use(piniaPlugin, { pinia });
45+
3446
app.mount('#app');
3547
})();

0 commit comments

Comments
 (0)