Skip to content
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

Setting build.outDir to current or parent directories breaks server restart / hot reload #16402

Closed
7 tasks done
5-tom opened this issue Apr 11, 2024 · 1 comment · Fixed by #16454
Closed
7 tasks done

Comments

@5-tom
Copy link

5-tom commented Apr 11, 2024

Describe the bug

If you set build.outDir in defineConfig to the current (.) or parent (..) directory, the server no longer restarts when files are modified.

import { defineConfig } from 'vite';

export default defineConfig({
  build: {
    outDir: ".." // or '/', '.', '..', '../../' etc.
  },
});

Reproduction

https://stackblitz.com/edit/vitejs-vite-xhnq6i?file=index.html

Steps to reproduce

Modify vite.config.js to include build.outDir as "..". Restart vite for your config to come into effect and then modify any file. The server will not restart.

System Info

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 7.97 GB / 15.35 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.6.2 - ~/.nvm/versions/node/v21.6.2/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v21.6.2/bin/npm

Used Package Manager

npm

Logs

No response

Validations

Copy link

stackblitz bot commented Apr 11, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@github-actions github-actions bot locked and limited conversation to collaborators May 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant