Skip to content

Commit 4ec06e5

Browse files
committed
storybook update try
1 parent 0258687 commit 4ec06e5

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

client/.storybook/main.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { StorybookConfig } from "@storybook/vue3-vite";
2+
import { mergeConfig } from "vite";
23

34
const config: StorybookConfig = {
45
framework: {
@@ -17,8 +18,10 @@ const config: StorybookConfig = {
1718
builder: "@storybook/builder-vite",
1819
},
1920

20-
async viteFinal(config) {
21-
return config;
21+
async viteFinal(cfg) {
22+
return mergeConfig(cfg, {
23+
base: "/storybook/",
24+
});
2225
},
2326
};
2427

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"test:e2e:interactive": "npx playwright codegen http://localhost:8082",
2929
"test:e2e:chromium": "npx playwright test --project=chromium --headed",
3030
"build-storybook": "storybook build --disable-telemetry",
31-
"postbuild-storybook": "node -e \"const fs=require('fs'); const p='./storybook-static/index.html'; let s=fs.readFileSync(p,'utf8'); s=s.replace('<head>', '<head>\\n<base href=\\\"/storybook/\\\">'); fs.writeFileSync(p,s);\""
31+
"postbuild-storybook": "node -e \"const fs=require('fs'); const files=['./storybook-static/index.html','./storybook-static/iframe.html']; for (const p of files){ if(!fs.existsSync(p)) continue; let s=fs.readFileSync(p,'utf8'); if(!s.includes('<base ')){ s=s.replace('<head>', '<head>\\n<base href=\\\"/storybook/\\\">'); fs.writeFileSync(p,s);} }\""
3232
},
3333
"lint-staged": {
3434
"*.{vue,js,jsx,ts,tsx}": [

0 commit comments

Comments
 (0)