Skip to content

Commit

Permalink
fix: import url path
Browse files Browse the repository at this point in the history
  • Loading branch information
hashrock committed Dec 14, 2023
1 parent 27a82e7 commit c6e074f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions routes/stories.tsx
Expand Up @@ -35,14 +35,15 @@ export function getHandler(options?: StoriesPluginOptions) {

let code: string | null = null;
const importFilePath = new URL(path, projectBasePath);
code = await Deno.readTextFile(importFilePath);
const story = await import(
importFilePath.pathname
importFilePath.href
);
const { description: importedDescription } = story;

ctx.state.description = importedDescription;
ctx.state.stories = stories;

code = await Deno.readTextFile(importFilePath);
ctx.state.code = code;
return await ctx.render();
},
Expand Down

0 comments on commit c6e074f

Please sign in to comment.