-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Docs: Mention Vite publicDir interference #33438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,10 @@ Sets a list of directories of [static files](../../configure/integration/images- | |
|
|
||
| {/* prettier-ignore-end */} | ||
|
|
||
| <Callout variant="info"> | ||
| When using Vite-based frameworks, additional directories may be copied to your build directory because of Vite's own [static asset handling](https://vite.dev/guide/assets#the-public-directory). You can set Vite's `publicDir` option to `false` to disable this behavior. | ||
| </Callout> | ||
|
Comment on lines
+20
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: Summary — Vite publicDir behavior (concise)
If you want specific examples or how to set publicDir in vite.config.ts, tell me which format (JS/TS) you use. Citations:
🌐 Web query:
💡 Result: Summary — Vite public directory (static assets)
Sources: Vite docs — Static Asset Handling and config (publicDir). [1][2][3] 🌐 Web query:
💡 Result: Short answer: Use Storybook's staticDirs in .storybook/main.js|ts for static assets (served at /path), and — if you need Vite's publicDir behavior — set Vite's publicDir inside the Vite config that Storybook uses (via core.builder.viteConfigPath or viteFinal). Example patterns:
References:
If you want, tell me which behavior you need (Storybook-only staticDirs vs full Vite publicDir) and I’ll give the exact file snippets for your project. Add context on how to configure Vite's The technical information is accurate—setting 🤖 Prompt for AI Agents |
||
|
|
||
| ## With configuration objects | ||
|
|
||
| You can also use a configuration object to define the directories: | ||
|
|
@@ -25,4 +29,4 @@ You can also use a configuration object to define the directories: | |
|
|
||
| <CodeSnippets path="main-config-static-dirs-with-object.md" /> | ||
|
|
||
| {/* prettier-ignore-end */} | ||
| {/* prettier-ignore-end */} | ||
Uh oh!
There was an error while loading. Please reload this page.