Skip to content

Commit

Permalink
Adjust some more docs for mono-repo adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Jan 8, 2025
1 parent 6acf3f8 commit fd79fd6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
21 changes: 18 additions & 3 deletions docs/_snippets/vitest-plugin-vitest-config.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
```ts filename="vitest.config.ts" renderer="react"
import { defineConfig, mergeConfig } from 'vitest/config';
import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
// 👇 If you're using Next.js, apply this framework plugin as well
// import { storybookNextJsPlugin } from '@storybook/experimental-nextjs-vite/vite-plugin';

const dirname =
typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));

import viteConfig from './vite.config';

export default mergeConfig(
Expand All @@ -12,7 +17,7 @@ export default mergeConfig(
plugins: [
storybookTest({
// The location of your Storybook config, main.js|ts
configDir: './.storybook',
configDir: path.join(dirname, '.storybook'),
// This should match your package.json script to run Storybook
// The --ci flag will skip prompts and not open a browser
storybookScript: 'yarn storybook --ci',
Expand All @@ -38,16 +43,21 @@ export default mergeConfig(
import { defineConfig, mergeConfig } from 'vitest/config';
import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';
import { storybookVuePlugin } from '@storybook/vue3-vite/vite-plugin';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

import viteConfig from './vite.config';

const dirname =
typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));

export default mergeConfig(
viteConfig,
defineConfig({
plugins: [
storybookTest({
// The location of your Storybook config, main.js|ts
configDir: './.storybook',
configDir: path.join(dirname, '.storybook'),
// This should match your package.json script to run Storybook
// The --ci flag will skip prompts and not open a browser
storybookScript: 'yarn storybook --ci',
Expand All @@ -72,9 +82,14 @@ export default mergeConfig(
```ts filename="vitest.config.ts" renderer="svelte"
import { defineConfig, mergeConfig } from 'vitest/config';
import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
// 👇 If you're using Sveltekit, apply this framework plugin as well
// import { storybookSveltekitPlugin } from '@storybook/sveltekit/vite-plugin';

const dirname =
typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));

import viteConfig from './vite.config';

export default mergeConfig(
Expand All @@ -83,7 +98,7 @@ export default mergeConfig(
plugins: [
storybookTest({
// The location of your Storybook config, main.js|ts
configDir: './.storybook',
configDir: path.join(dirname, '.storybook'),
// This should match your package.json script to run Storybook
// The --ci flag will skip prompts and not open a browser
storybookScript: 'yarn storybook --ci',
Expand Down
4 changes: 2 additions & 2 deletions docs/_snippets/vitest-plugin-vitest-workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default defineWorkspace([
plugins: [
storybookTest({
// The location of your Storybook config, main.js|ts
configDir: path.join(dirname, './.storybook'),
configDir: path.join(dirname, '.storybook'),
// This should match your package.json script to run Storybook
// The --ci flag will skip prompts and not open a browser
storybookScript: 'yarn storybook --ci',
Expand Down Expand Up @@ -109,7 +109,7 @@ export default defineWorkspace([
plugins: [
storybookTest({
// The location of your Storybook config, main.js|ts
configDir: path.join(dirname, './.storybook'),
configDir: path.join(dirname, '.storybook'),
// This should match your package.json script to run Storybook
// The --ci flag will skip prompts and not open a browser
storybookScript: 'yarn storybook --ci',
Expand Down

0 comments on commit fd79fd6

Please sign in to comment.