docs/_snippets/nextjs-framework-options-next-config-path.md
import path from 'node:path';
export default {
// ...
framework: {
name: '@storybook/your-framework',
options: {
nextConfigPath: path.resolve(process.cwd(), 'next.config.js'),
},
},
};
import path from 'node:path';
// Replace your-framework with nextjs or nextjs-vite
import type { StorybookConfig } from '@storybook/your-framework';
const config: StorybookConfig = {
// ...
framework: {
name: '@storybook/your-framework',
options: {
nextConfigPath: path.resolve(process.cwd(), 'next.config.js'),
},
},
};
export default config;
import path from 'node:path';
// Replace your-framework with nextjs or nextjs-vite
import { defineMain } from '@storybook/your-framework/node';
export default defineMain({
// ...
framework: {
name: '@storybook/your-framework',
options: {
nextConfigPath: path.resolve(process.cwd(), 'next.config.js'),
},
},
});
import path from 'node:path';
// Replace your-framework with nextjs or nextjs-vite
import { defineMain } from '@storybook/your-framework/node';
export default defineMain({
// ...
framework: {
name: '@storybook/your-framework',
options: {
nextConfigPath: path.resolve(process.cwd(), 'next.config.js'),
},
},
});