-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
build.emptyOutDir
no longer empties out the entire directory since v3.2.x
#10696
Comments
The previous behavior was considered as a bug and changed by #9748. I'm not sure which one is more natural. |
What we defined in #9748 for nested output dirs is that the contents of all output folders would be deleted (but not the nested folder structure). cc @qmhc The repro doesn't have multiple output dirs, only one that overwrites the value of |
In my thought, we can allow the |
@patak-dev the repro was minimal to show how to reproduce, but we do use Also, stands to reason (imho) that if you have:
Then the |
I completely agree with @benjaminprojas here. I think that the root |
Describe the bug
In the past, using
build.emptyOutDir
would empty out the entire directory defined bybuild.outDir
even when thebuild.rollupOptions.output.dir
was set to a different directory. Since v3.2.0 this has changed to only empty out what is defined inbuild.rollupOptions.output.dir
Reproduction
https://stackblitz.com/edit/vitejs-vite-lmgy3k?file=vite.config.js,package.json
Steps to reproduce
There is a file inside
dist
called:file-to-be-removed.html
. This file should be deleted when a new build is made (dist directory is emptied).run
npm run build
to see that the files inside thedist
directory are not deleted, only the files inside thedist/assets
directory are deleted.Alternatively, use the following for 3.1.8 to see it working as expected: https://stackblitz.com/edit/vitejs-vite-lmgy3k?file=vite.config.js,package.json
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: