Skip to content

Commit

Permalink
docs: note TS caveat about module exports
Browse files Browse the repository at this point in the history
closes #13554
  • Loading branch information
dummdidumm committed Oct 23, 2024
1 parent 134049f commit 907a213
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions documentation/docs/01-introduction/03-svelte-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ A `<script>` tag with a `module` attribute runs once when the module first evalu

You can `export` bindings from this block, and they will become exports of the compiled module. You cannot `export default`, since the default export is the component itself.

> [!NOTE] If you are using TypeScript and import such exports from a `module` block into a `.ts` file, make sure to have your editor setup so that TypeScript knows about them. This is the case for our VS Code extension and the IntelliJ plugin, in other cases you might need to setup our [TypeScript editor plugin](https://www.npmjs.com/package/typescript-svelte-plugin).
> [!LEGACY]
> In Svelte 4, this script tag was created using `<script context="module">`
Expand Down

0 comments on commit 907a213

Please sign in to comment.