michmich112 / sveltekit-adapter-chrome-extension

Sveltekit adapter for making chrome extensions
MIT License
108 stars 17 forks source link

Add option that prevents file removal #20

Closed timopruesse closed 1 year ago

timopruesse commented 1 year ago

Hey,

first of all, thanks for creating this adapter. It's quite useful.

I had an issue using it in the 'watch mode', though. I have some other watch commands running as well. When a file change is detected and the adapter rebuilds the output, it first removes all files in the build directory. This, of course, also removes all other files generated by the other commands.

I added an option to disable that behavior if wanted. I named it like it is named in the vite build config emptyOutDir.

michmich112 commented 1 year ago

Hey @Chroma91 Thank you for this contribution! Definitely see the problem, thanks for solving it! I'm merging your PR into the main branch and will update the Readme.md to add documentation around the emptyOutDir option. This will be the core of the v1.4.0 release as it builds upon the existing configuration options without breaking changes. Thank you once again!