You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix vite-plugin serving dist instead of source during dev
When using @netlify/vite-plugin with a SPA-style redirect (e.g., /* -> /index.html) and a build.publish directory (e.g., dist) in netlify.toml, the plugin was incorrectly serving files from the dist directory instead of the source directory during vite dev.
The issue was in @netlify/dev where the static handler was prepending the build.publish directory to the list of static directories, causing it to check dist first before the source directories passed by the vite plugin.
The fix changes the logic so that if custom static directories are provided (e.g., by vite-plugin during dev), only those directories are used. Otherwise, the build.publish directory from config is used as a fallback.
Also added .netlify to .gitignore in vite-plugin.
Co-authored-by: serhalp <[email protected]>
0 commit comments