-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Open
Description
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
- Create a new app with storybook (for instance
npm create vite@latestthennpx storybook@latest init) - Create a file
public/index.jsonand put an empty JSON inside{} - Set the staticDirs to anything other than
../public, for instancestaticDirs: [ { from: "../public", to: "/foo" } ], - Run the storybook build
npm run build-storybook storybook-static/index.jsondoesn't contain the necessary data (should be something like{ v:4, entries: {...) but instead is set at whatever you put in thepublic/index.jsonfile (in this example, it's{})storybook-static/foocontains a copy of whatever was in the../publicfolder (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
pronitsateli731, izumix03, ferg-usi, allan-tactiq and JalenWasHere