Skip to content

Commit

Permalink
fix: create a require for mdx stories
Browse files Browse the repository at this point in the history
  • Loading branch information
pndewit committed Nov 17, 2023
1 parent c6a7860 commit c796648
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/witty-ladybugs-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@web/dev-server-storybook': patch
---

fix: create a require for mdx stories
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { createRequire } from 'node:module';
import mdx from '@mdx-js/mdx';
import { transformAsync } from '@babel/core';
// @ts-ignore
import { createCompiler } from '@storybook/csf-tools/mdx.js';
import { createError } from '../utils.js';

const require = createRequire(import.meta.url);
const compilers = [createCompiler({})];

export async function transformMdxToCsf(body: string, filePath: string): Promise<string> {
Expand Down

0 comments on commit c796648

Please sign in to comment.