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

View file

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