UNPKG

vite-plugin-storybook-nextjs

Version:

This is a Vite plugin that allows you to use Next.js features in Vite. It is the basis for `@storybook/experimental-nextjs-vite` and should be used when running portable stories in Vitest.

24 lines (20 loc) 729 B
import { Plugin } from 'vite'; import { FilterPattern } from '@rollup/pluginutils'; type NextImagePluginOptions = { includeFiles?: FilterPattern; excludeFiles?: FilterPattern; }; type PluginOptions = { /** * Provide the path to your Next.js project directory * @default process.cwd() */ dir?: string; /** * Control which image files are handled by the next-image plugin. * @see https://github.com/storybookjs/vite-plugin-storybook-nextjs/blob/main/README.md#faq-includingexcluding-images */ image?: NextImagePluginOptions; }; declare function VitePlugin({ dir, image, }?: PluginOptions): (Plugin | Promise<Plugin>)[]; export { type PluginOptions, VitePlugin as default };