Hello, I have built an app and I want to share some code between my app and its extensions, but when Im in my extensions folder I cannot import code from parent folder or outside, Im using Vite.
How can I share some code between my app and its extensions ?
Hey @luigi_cavinato I can’t say for sure without a bit more info, but what you’re reporting does seem to actually be by design in our extension architecture.
Extensions are intentionally isolated and built separately from your main app because they run in sandboxed environments like Web Workers for security reasons, which means you can’t import code from parent directories the way you normally would in a regular app.
There’s a bit more info on this in our docs here that goes over how we expect apps and extensions to be organized. The recommendation in this case would be to duplicate the necessary code directly into your extensions folder, since extensions are deployed and run separately from your main app and need their dependencies packaged with them rather than relying on imports from outside their directory. Hope this helps, let me know if I can clarify anything on our end here!