I can put anything I like into the staticDirs config option, "../public" will always be copied at the root of the storybook-static folder during the last phase of the build.
My problem is: "../public" contains data unrelated to Storybook (for instance pdf document to download in the app) and, more importantly, "../public" contains an index.json file that will override the storybook generated index.json, breaking the build in the process (because without the index, stories are not found).
If it's working as intended, could someone point out how I can go over that and NOT copy index.json into "/storybook-static"?
To Reproduce
Create a new app with storybook (for instance npm create vite@latest then npx storybook@latest init)
Create a file public/index.json and put an empty JSON inside {}
Set the staticDirs to anything other than ../public, for instance staticDirs: [ { from: "../public", to: "/foo" } ],
Run the storybook build npm run build-storybook
storybook-static/index.json doesn't contain the necessary data (should be something like { v:4, entries: {...) but instead is set at whatever you put in the public/index.json file (in this example, it's {})
storybook-static/foo contains a copy of whatever was in the ../public folder (so the staticDirs property works BUT the copy is done twice, once at the root, once at the directory I asked it to use)
Describe the bug
I can put anything I like into the
staticDirs
config option, "../public" will always be copied at the root of the storybook-static folder during the last phase of the build.My problem is: "../public" contains data unrelated to Storybook (for instance pdf document to download in the app) and, more importantly, "../public" contains an index.json file that will override the storybook generated index.json, breaking the build in the process (because without the index, stories are not found).
If it's working as intended, could someone point out how I can go over that and NOT copy
index.json
into "/storybook-static"?To Reproduce
npm create vite@latest
thennpx storybook@latest init
)public/index.json
and put an empty JSON inside{}
../public
, for instancestaticDirs: [ { from: "../public", to: "/foo" } ],
npm run build-storybook
storybook-static/index.json
doesn't contain the necessary data (should be something like{ v:4, entries: {...
) but instead is set at whatever you put in thepublic/index.json
file (in this example, it's{}
)storybook-static/foo
contains a copy of whatever was in the../public
folder (so the staticDirs property works BUT the copy is done twice, once at the root, once at the directory I asked it to use)System
No response
Additional context
No response