Skip to content

Commit

Permalink
fix: server-side build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jeangovil committed Jun 15, 2023
1 parent be30d90 commit c65e072
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@ export const useBlogPluginData = () => {
].includes(plugin[0] as string),
)

if (plugins.length === 0)
return {
routeBasePath: '/blog',
} as Partial<PluginOptions>

const plugin = plugins.find((plugin) =>
window.location.pathname.startsWith(
(plugin as [string, PluginOptions])[1].routeBasePath,
),
(typeof window !== 'undefined'
? window.location.pathname
: '/blog'
).startsWith((plugin as [string, PluginOptions])[1].routeBasePath),
)

if (!plugin)
Expand Down

0 comments on commit c65e072

Please sign in to comment.