docs/_snippets/storybook-main-pnpm-with-module-resolution.md
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const getAbsolutePath = (packageName) =>
dirname(fileURLToPath(import.meta.resolve(`${packageName}/package.json`)));
export default {
framework: {
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, vue3-vite, etc.
name: getAbsolutePath('@storybook/your-framework'),
options: {},
},
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
//๐ Use getAbsolutePath when referencing Storybook's addons and frameworks
getAbsolutePath('@storybook/addon-docs'),
],
};
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, vue3-vite, etc.
import type { StorybookConfig } from '@storybook/your-framework';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const getAbsolutePath = (packageName: string) =>
dirname(fileURLToPath(import.meta.resolve(`${packageName}/package.json`)));
const config: StorybookConfig = {
framework: {
// Replace your-framework with the same one you've imported above.
name: getAbsolutePath('@storybook/your-framework'),
options: {},
},
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
//๐ Use getAbsolutePath when referencing Storybook's addons and frameworks
getAbsolutePath('@storybook/addon-docs'),
],
};
export default config;
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
// Replace your-framework with the framework you are using (e.g., react-vite, nextjs, nextjs-vite)
import { defineMain } from '@storybook/your-framework/node';
const getAbsolutePath = (packageName: string) =>
dirname(fileURLToPath(import.meta.resolve(join(packageName, 'package.json'))));
export default defineMain({
framework: {
// Replace your-framework with the framework you are using (e.g., react-vite, nextjs, nextjs-vite)
name: getAbsolutePath('@storybook/your-framework'),
options: {},
},
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
//๐ Use getAbsolutePath when referencing Storybook's addons and frameworks
getAbsolutePath('@storybook/addon-docs'),
],
});
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
// Replace your-framework with the framework you are using (e.g., react-vite, nextjs, nextjs-vite)
import { defineMain } from '@storybook/your-framework/node';
const getAbsolutePath = (packageName) =>
dirname(fileURLToPath(import.meta.resolve(join(packageName, 'package.json'))));
export default defineMain({
framework: {
name: getAbsolutePath('@storybook/your-framework'),
options: {},
},
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
//๐ Use getAbsolutePath when referencing Storybook's addons and frameworks
getAbsolutePath('@storybook/addon-docs'),
],
});
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineMain } from '@storybook/vue3-vite/node';
const getAbsolutePath = (packageName: string) =>
dirname(fileURLToPath(import.meta.resolve(join(packageName, 'package.json'))));
export default defineMain({
framework: {
name: getAbsolutePath('@storybook/vue3-vite'),
options: {},
},
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
//๐ Use getAbsolutePath when referencing Storybook's addons and frameworks
getAbsolutePath('@storybook/addon-docs'),
],
});
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineMain } from '@storybook/vue3-vite/node';
const getAbsolutePath = (packageName) =>
dirname(fileURLToPath(import.meta.resolve(join(packageName, 'package.json'))));
export default defineMain({
framework: {
name: getAbsolutePath('@storybook/vue3-vite'),
options: {},
},
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
//๐ Use getAbsolutePath when referencing Storybook's addons and frameworks
getAbsolutePath('@storybook/addon-docs'),
],
});
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineMain } from '@storybook/angular/node';
const getAbsolutePath = (packageName: string) =>
dirname(fileURLToPath(import.meta.resolve(join(packageName, 'package.json'))));
export default defineMain({
framework: {
name: getAbsolutePath('@storybook/angular'),
options: {},
},
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
//๐ Use getAbsolutePath when referencing Storybook's addons and frameworks
getAbsolutePath('@storybook/addon-docs'),
],
});
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineMain } from '@storybook/web-components-vite/node';
const getAbsolutePath = (packageName: string) =>
dirname(fileURLToPath(import.meta.resolve(join(packageName, 'package.json'))));
export default defineMain({
framework: {
name: getAbsolutePath('@storybook/web-components-vite'),
options: {},
},
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
//๐ Use getAbsolutePath when referencing Storybook's addons and frameworks
getAbsolutePath('@storybook/addon-docs'),
],
});
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineMain } from '@storybook/web-components-vite/node';
const getAbsolutePath = (packageName) =>
dirname(fileURLToPath(import.meta.resolve(join(packageName, 'package.json'))));
export default defineMain({
framework: {
name: getAbsolutePath('@storybook/web-components-vite'),
options: {},
},
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
//๐ Use getAbsolutePath when referencing Storybook's addons and frameworks
getAbsolutePath('@storybook/addon-docs'),
],
});