feat: support multiple staticDir entries#3759
Merged
Merged
Conversation
Allow `staticDir` to accept an array of directories. When multiple directories are specified, they are searched in order and the first match wins. This is useful for separating generated assets from hand-authored static files. Closes #3105 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extend the Vite plugin with the same staticDir array support added to the Builder API. The first directory maps to Vite's native publicDir; extra directories are served manually in the dev server and walked during production builds with first-match-wins semantics. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The CI typo checker flags "Pn" as a misspelling of "On". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Windows runners were occasionally timing out at 10 minutes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 27, 2026
Merged
bartlomieju
added a commit
that referenced
this pull request
Apr 27, 2026
- Bump `@fresh/core` to `2.3.1` - Bump `@fresh/init` to `2.3.1` - Bump `@fresh/update` to `2.3.1` - Bump `@fresh/plugin-vite` from `1.0.8` to `1.1.0` - Bump `@fresh/plugin-tailwind-v3` from `1.0.1` to `1.1.0` The plugin packages were not published during the 2.3.0 release despite having significant changes merged. Notable fixes in `@fresh/plugin-vite` include immutable caching for Vite-built assets (#3761), CSS modules in layouts (#3764), and multiple `staticDir` support (#3759). Also updates `FRESH_VITE_PLUGIN` version constant in `@fresh/init` so new projects scaffold with the correct plugin version. Closes #3784
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
staticDirnow acceptsstring | string[]in both the Vite plugin (FreshViteConfig) and the Builder API (BuildOptions)publicDir; extra dirs are served manually in the dev server and walked during production buildsMemoryBuildCache(dev) andDiskBuildCache(prod) iterate over all directoriesconfig.rootinstead ofpath.dirname(config.staticDir)static-files.md,vite.md,builder.mdCloses #3105
Test plan
Builder - multiple staticDir in dev— serves files from both dirs, first-dir-wins for conflictsBuilder - multiple staticDir in prod— same behavior in production builds🤖 Generated with Claude Code