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
It appears that vite build --watch only copies over public once when initialised, instead of watching them. We expect them to be watched just like other source files.
We use Vite to build a website with a service worker into a static directory, so that our custom HTTP server can pick it up. The website has a service worker and it needs different build settings than the main site. We have a separate vite build --watch --outDir=public --config=vite.sw.config.ts process that does that. We expect the main vite build --watch process to watch file changes in public just like it watches file changes from outher sources, and we expect it to sync those changes into its out dir so our custom HTTP server can pick them up.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
It appears that
vite build --watch
only copies overpublic
once when initialised, instead of watching them. We expect them to be watched just like other source files.We use Vite to build a website with a service worker into a static directory, so that our custom HTTP server can pick it up. The website has a service worker and it needs different build settings than the main site. We have a separate
vite build --watch --outDir=public --config=vite.sw.config.ts
process that does that. We expect the mainvite build --watch
process to watch file changes inpublic
just like it watches file changes from outher sources, and we expect it to sync those changes into its out dir so our custom HTTP server can pick them up.Reproduction
https://github.com/Skn0tt/vite-build-watch-public-repro
Steps to reproduce
npm ci
npx vite build --watch
public/foo
expected:
dist/foo
contains updated contentactual:
dist/foo
contains content old content from whennpx vite build --watch
was startedSystem Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: