Skip to content

Commit

Permalink
Adjusts pnpm snippets to prevent regression
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniebigodes committed Jul 25, 2023
1 parent daa1b33 commit d2711ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@

import path from 'path';

const wrapForPnp = (packageName) =>
const getAbsolutePath = (packageName) =>
path.dirname(require.resolve(path.join(packageName, 'package.json')));

export default {
framework: {
// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)
name: wrapForPnp('@storybook/your-framework'),
name: getAbsolutePath('@storybook/your-framework'),
options: {},
},
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
//👇 Use wrapForPnp when referencing Storybook's addons and frameworks
wrapForPnp('@storybook/addon-essentials'),
//👇 Use getAbsolutePath when referencing Storybook's addons and frameworks
getAbsolutePath('@storybook/addon-essentials'),
],
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ import type { StorybookConfig } from '@storybook/your-framework';

import path from 'path';

const wrapForPnp = (packageName: string) =>
const getAbsolutePath = (packageName: string): any =>
path.dirname(require.resolve(path.join(packageName, 'package.json')));

const config: StorybookConfig = {
framework: {
// Replace your-framework with the same one you've imported above.
name: wrapForPnp('@storybook/your-framework'),
name: getAbsolutePath('@storybook/your-framework'),
options: {},
},
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
//👇 Use wrapForPnp when referencing Storybook's addons and frameworks
wrapForPnp('@storybook/addon-essentials'),
//👇 Use getAbsolutePath when referencing Storybook's addons and frameworks
getAbsolutePath('@storybook/addon-essentials'),
],
};

Expand Down

0 comments on commit d2711ed

Please sign in to comment.