Closed kenzWeb closed 1 month ago
hi @kenzWeb,
i am unaware of a possibility to make modules global without breaking tree-shaking.
i also advice you against globals. the imports might be annoying but it works. global magic will likely introduce regressions bugs.
in terms of achieving global modules, check the vite docs https://vitest.dev/. paraglide js emits regular javascript code.
closing because not directly related to paraglide js
Hello,
I'm working on a SvelteKit project and using a module frequently across multiple files, specifically
messages.js
from$lib/paraglide
. Currently, I have to import it manually in each file like this:Is there a way to make this module available globally throughout the project, so I don't have to import it every time?
Any advice or recommended best practices would be greatly appreciated.
Thank you!