Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

globally expose $_ in svelte?

See original GitHub issue

I’d rather not do import { _ } from 'svelte-i18n in every file. Is there a way to globally expose this to my app such that all the component files have it?

I’m using rollupjs

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

shfxcommented, Nov 20, 2019
kaisermanncommented, Mar 29, 2020

I’m going to close this as I think it’s a bit too magical. If more people show interest in this, we can revive the discussion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docs • Svelte
SvelteKit will handle calling the Svelte compiler to convert your .svelte files into .js files ... To apply styles to a selector globally,...
Read more >
globally expose $_ in svelte? · Issue #21 - GitHub
Currently no! As a workaround you can make a quick and naive preprocessor to prepend that statement at the beginning of your svelte...
Read more >
Call Svelte component's function from global scope
Is there a way to access/call Svelte's component function from global webpage scope? It might be of use for interop with external libraries ......
Read more >
How to export functions and variables from a Svelte component
Learn how to export functions and variables from a Svelte component. ... You know that you can import a Svelte component into another...
Read more >
Working with Svelte stores - Learn web development | MDN
In this article we will show another way to handle state management in Svelte: Stores. Stores are global data repositories that hold values....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found