I'm trying to use Storybook with a Svelte component library. Svelte is set up to use Rollup. I wonder if Storybook's use of Webpack could have anything to do with my issue?
- Storybook is working just fine as long as my svelte components are written in JS
- Svelte is set up to work with TS just fine
- adding even a simple type declaration to a component's script breaks Storybook
Example:
I changed this:
<script lang="ts">
export let text = ''
export let sent = true
</script>
to this:
<script lang="ts">
export let text: string
export let sent: boolean
</script>
I get this error:
Module build failed (from ./node_modules/svelte-loader/index.js):
Error: ParseError: Unexpected token (2:17)
1: <script lang="ts">
2: export let text: string
^