gavinmcfarland / plugma

Take Figma plugin development to the next level
https://plugma.dev
MIT License
56 stars 3 forks source link

Env variables in main thread don't reload after editing file #26

Closed gavinmcfarland closed 2 weeks ago

gavinmcfarland commented 1 month ago

When you edit env variables, they are not updated in the main code. Historically Plugma has used esbuild to bundle the main code. It's more appropriate than Vite as Vite is typically intended for frontend bundling. However Vite has it's own implementation of mananaging env variables. I tried to leverage this to see if I could get Vite to build the main code. There were some challenges, but mainly the biggest issue was it causing the server to crash after quick succession of builds. I don't know if this was an issue of Vite itself, or the issue of having two bundling processes in the same space. It would require more investigation.

gavinmcfarland commented 1 month ago

This was a complicated issue to work around but I think I've created a patch for this in the next release.

gavinmcfarland commented 2 weeks ago

This is now fixed in the next major release.