Skip to content

Commit

Permalink
storybook vite config add plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoperra committed Nov 19, 2023
1 parent 33a6262 commit 2c63ba1
Show file tree
Hide file tree
Showing 3 changed files with 388 additions and 2,193 deletions.
17 changes: 16 additions & 1 deletion packages/storybook/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { StorybookConfig } from "storybook-solidjs-vite";

import { join, dirname } from "path";
import { dirname, join } from "path";
import { mergeConfig } from "vite";

/**
* This function is used to resolve the absolute path of a package.
Expand All @@ -25,6 +26,20 @@ const config: StorybookConfig = {
docs: {
autodocs: "tag",
},
async viteFinal(config) {
// Merge custom configuration into the default config
return mergeConfig(config, {
// Add dependencies to pre-optimization
optimizeDeps: {
include: [
"storybook-dark-mode",
"@codeui/kit",
"@kobalte/core",
"@kobalte/utils",
],
},
});
},
};

export default config;
31 changes: 16 additions & 15 deletions packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,39 @@
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"storybook:run": "storybook",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"devDependencies": {
"@storybook/addon-docs": "^7.5.3",
"@storybook/addon-essentials": "7.5.3",
"@storybook/addon-interactions": "7.5.3",
"@storybook/addon-links": "7.5.3",
"@storybook/addon-essentials": "^7.5.3",
"@storybook/addon-interactions": "^7.5.3",
"@storybook/addon-links": "^7.5.3",
"@storybook/addon-styling": "^1.3.7",
"@storybook/addons": "^7.5.3",
"@storybook/api": "^7.5.3",
"@storybook/blocks": "7.5.3",
"@storybook/blocks": "^7.5.3",
"@storybook/components": "^7.5.3",
"@storybook/manager-api": "^7.5.3",
"@storybook/testing-library": "0.2.2",
"@storybook/testing-library": "^0.2.2",
"@storybook/theming": "^7.5.3",
"@vanilla-extract/vite-plugin": "^3.8.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"storybook": "7.5.3",
"@vanilla-extract/vite-plugin": "^3.9.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"storybook": "^7.5.3",
"storybook-dark-mode": "^3.0.1",
"storybook-solidjs": "1.0.0-beta.2",
"storybook-solidjs-vite": "1.0.0-beta.2",
"storybook-solidjs": "^1.0.0-beta.2",
"storybook-solidjs-vite": "^1.0.0-beta.2",
"typescript": "^5.0.2",
"vite": "^4.4.5",
"vite-plugin-solid": "^2.7.0",
"vite-plugin-solid": "^2.7.2",
"vite-tsconfig-paths": "^4.2.1"
},
"dependencies": {
"@kobalte/core": "^0.11.0",
"@kobalte/core": "^0.11.2",
"@kobalte/utils": "^0.9.0",
"@vanilla-extract/css": "^1.11.0",
"solid-js": "^1.7.3"
"@vanilla-extract/css": "^1.14.0",
"solid-js": "^1.8.5"
}
}
Loading

0 comments on commit 2c63ba1

Please sign in to comment.