Skip to content

Commit 594e3ab

Browse files
authored
docs: note TS caveat about module exports (#13842)
closes #13554
1 parent af4d105 commit 594e3ab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

documentation/docs/01-introduction/03-svelte-files.md

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ A `<script>` tag with a `module` attribute runs once when the module first evalu
5050

5151
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.
5252

53+
> [!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).
54+
5355
> [!LEGACY]
5456
> In Svelte 4, this script tag was created using `<script context="module">`
5557

0 commit comments

Comments
 (0)