docs/_snippets/before-all-in-preview.md
import { init } from '../project-bootstrap';
export default {
async beforeAll() {
await init();
},
};
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, vue3-vite, etc.
import type { Preview } from '@storybook/your-framework';
import { init } from '../project-bootstrap';
const preview: Preview = {
async beforeAll() {
await init();
},
};
export default preview;
// Replace your-framework with the framework you are using (e.g., react-vite, nextjs, nextjs-vite)
import { definePreview } from '@storybook/your-framework';
import { init } from '../project-bootstrap';
export default definePreview({
async beforeAll() {
await init();
},
});
// Replace your-framework with the framework you are using (e.g., react-vite, nextjs, nextjs-vite)
import { definePreview } from '@storybook/your-framework';
import { init } from '../project-bootstrap';
export default definePreview({
async beforeAll() {
await init();
},
});
import { definePreview } from '@storybook/vue3-vite';
import { init } from '../project-bootstrap';
export default definePreview({
async beforeAll() {
await init();
},
});
import { definePreview } from '@storybook/vue3-vite';
import { init } from '../project-bootstrap';
export default definePreview({
async beforeAll() {
await init();
},
});
import { definePreview } from '@storybook/angular';
import { init } from '../project-bootstrap';
export default definePreview({
async beforeAll() {
await init();
},
});
import { definePreview } from '@storybook/web-components-vite';
import { init } from '../project-bootstrap';
export default definePreview({
async beforeAll() {
await init();
},
});
import { definePreview } from '@storybook/web-components-vite';
import { init } from '../project-bootstrap';
export default definePreview({
async beforeAll() {
await init();
},
});