Commit 71ed852
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]>1 parent 0300389 commit 71ed852
2 files changed
+11
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
585 | 592 | | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
| 593 | + | |
590 | 594 | | |
591 | 595 | | |
592 | 596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments