Skip to content

Commit c8aafa6

Browse files
feat: add base href to Storybook configuration and update build output directory
1 parent b8d6810 commit c8aafa6

4 files changed

Lines changed: 7 additions & 1 deletion

File tree

.storybook/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@ const config = {
66
'name': '@storybook/react-vite',
77
'options': {},
88
},
9+
viteFinal: (config) => {
10+
config.base = '/storybook/';
11+
return config;
12+
},
913
};
1014
export default config;

.storybook/manager-head.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<base href="/storybook/">

.storybook/preview-head.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<base href="/storybook/">

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"prettier": "prettier --write .",
1111
"preview": "vite preview",
1212
"storybook": "storybook dev -p 6006",
13-
"build-storybook": "storybook build",
13+
"build-storybook": "storybook build --output-dir storybook-static",
1414
"test:storybook": "JEST_JUNIT_OUTPUT_DIR=reports JEST_JUNIT_OUTPUT_NAME=storybook.xml test-storybook --junit",
1515
"test:testing-library": "vitest --config ./vitest.config.js",
1616
"test:playwright": "PLAYWRIGHT_JUNIT_OUTPUT_DIR=reports PLAYWRIGHT_JUNIT_OUTPUT_NAME=playwright.xml playwright test -c playwright-ct.config.js --reporter=junit",

0 commit comments

Comments
 (0)