Skip to content

Commit

Permalink
build(storybook): fix storybook build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bsahitya committed May 13, 2024
1 parent c4cccaa commit cbefdd5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion libs/react-components/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { StorybookConfig } from '@storybook/react-vite';
import { resolve } from 'path';

const config: StorybookConfig = {
stories: ['../src/lib/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
Expand All @@ -7,7 +8,7 @@ const config: StorybookConfig = {
name: '@storybook/react-vite',
options: {
builder: {
viteConfigPath: 'libs/react-components/vite.config.ts',
viteConfigPath: resolve(__dirname, '../vite.config.ts'),
},
},
},
Expand Down
16 changes: 15 additions & 1 deletion libs/react-components/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,19 @@
"projectType": "library",
"tags": [],
"// targets": "to see all targets run: nx show project react-components --web",
"targets": {}
"targets": {
"build-storybook": {
"executor": "@nx/storybook:build",
"outputs": ["{options.outputDir}"],
"options": {
"outputDir": "dist/storybook/react-components",
"configDir": "libs/react-components/.storybook"
},
"configurations": {
"ci": {
"quiet": true
}
}
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"scripts": {
"semantic-release": "semantic-release --branches main",
"build-storybook": "storybook build -c libs/react-components/.storybook -o dist/storybook/react-components"
"build-storybook": "nx run react-components:build-storybook"
},
"dependencies": {
"react": "18.3.1",
Expand Down

0 comments on commit cbefdd5

Please sign in to comment.