fix build errors

This commit is contained in:
lightling 2024-05-17 18:20:20 -04:00
parent 8733c1131f
commit 2240c77ed4
2 changed files with 16 additions and 8 deletions

View file

@ -5,7 +5,6 @@ import { marked } from 'marked'
import { markedHighlight } from 'marked-highlight' import { markedHighlight } from 'marked-highlight'
import type { RoutedWindow } from '@goldenwere/mackenzii-types' import type { RoutedWindow } from '@goldenwere/mackenzii-types'
import { registerLinkEmbed } from '@goldenwere/mackenzii-embeds'
import main from './main.vue' import main from './main.vue'
import './main.sass' import './main.sass'
@ -31,9 +30,13 @@ export const createApp = ViteSSG(
// vue-router options // vue-router options
{ routes: createRoutes() }, { routes: createRoutes() },
// function to have custom setups // function to have custom setups
({ app, router, routes, isClient, initialState }) => { async ({ app, router, routes, isClient, initialState }) => {
registerLinkEmbed() if (isClient) {
window.router = router import('@goldenwere/mackenzii-embeds').then(({ registerLinkEmbed }) => {
registerLinkEmbed()
})
window.router = router
}
app.use(createPinia()) app.use(createPinia())
initializeRouteStore(routes) initializeRouteStore(routes)
}, },

View file

@ -1,11 +1,16 @@
import symlinkDir from 'symlink-dir'; import symlinkDir from 'symlink-dir';
import { existsSync } from 'fs';
import { mkdir } from 'fs/promises';
(() => { (async () => {
const site = process.env.npm_config_site; const site = process.env.npm_config_site;
if (!!site) { if (!!site) {
symlinkDir(`sites/${site}`, '../frontend/content').then((res) => { await symlinkDir(`sites/${site}`, '../frontend/content');
console.log('Done'); if (!existsSync('../frontend/dist')) {
}) await mkdir('../frontend/dist');
}
await symlinkDir(`sites/${site}`, '../frontend/dist/content');
console.log('done');
} else { } else {
console.error('Parameter "site" was not provided!'); console.error('Parameter "site" was not provided!');
} }