Skip to content

Commit

Permalink
add require.resolve around other places as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Aug 24, 2023
1 parent 06c554e commit ad7b476
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion code/addons/essentials/src/docs/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ export * from '@storybook/addon-docs/dist/preset';

export const mdxLoaderOptions = async (config: any) => {
// eslint-disable-next-line no-param-reassign
config.mdxCompileOptions.providerImportSource = '@storybook/addon-essentials/docs/mdx-react-shim';
config.mdxCompileOptions.providerImportSource = require.resolve(
'@storybook/addon-docs/dist/shims/mdx-react-shim'
);
return config;
};
2 changes: 1 addition & 1 deletion code/builders/builder-vite/src/plugins/mdx-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function mdxPlugin(options: Options): Promise<Plugin> {
const mdxLoaderOptions = await options.presets.apply('mdxLoaderOptions', {
...mdxPluginOptions,
mdxCompileOptions: {
providerImportSource: '@storybook/addon-docs/mdx-react-shim',
providerImportSource: require.resolve('@storybook/addon-docs/mdx-react-shim'),
...mdxPluginOptions?.mdxCompileOptions,
remarkPlugins: [remarkSlug, remarkExternalLinks].concat(
mdxPluginOptions?.mdxCompileOptions?.remarkPlugins ?? []
Expand Down

0 comments on commit ad7b476

Please sign in to comment.