I understand that you internally check if the user set build.emptyOutDir and then manually remove that folder before anything else because you definitely have to set it internally to false. So far, so good, but it seems that resolvedConfig.build.emptyOutDir was already overwritten at the time you test for it.
So, if I don't miss anything, the line referenced here
Summary
Hi!
I understand that you internally check if the user set
build.emptyOutDir
and then manually remove that folder before anything else because you definitely have to set it internally to false. So far, so good, but it seems thatresolvedConfig.build.emptyOutDir
was already overwritten at the time you test for it.So, if I don't miss anything, the line referenced here
https://github.com/aklinker1/vite-plugin-web-extension/blob/191fa4f69617e763da0ba334c914b45ff28801b7/packages/vite-plugin-web-extension/src/plugins/manifest-loader-plugin.ts#L222
should be
instead.
This is the only way I can get the plugin to empty out the dist folder before building the extension.
Reproduction
The default setup plus the
build.emptyOutDir
option set to true will be enough to demonstrate that the dist folder is not emptied.Feel free to let me know if you need anything else.
Environment
Thanks!