CloudCannon / bookshop

📚 A component development workflow for static websites.
MIT License
249 stars 21 forks source link

Add typescript support for Sveltekit #144

Open silveltman opened 1 year ago

silveltman commented 1 year ago

After setting the whole thing up, I found out that running the bookshop browser on components using typescript gives an error:

bookshop-import-file:components/sample/sample.svelte__bookshop_file__:1:17: note: The plugin "esbuild-svelte" was triggered by this import
    1 │ import file from "./components/sample/sample. Svelte";

sample.svelte:

<script lang="ts">
    export let text: 'test' | string = 'hello world'
</script>

<div class="c-sample bg-neutral-500 ">
    <p class="py">{text} hello</p>
</div>

Does this mean typescript is currently not supported at all?

bglw commented 1 year ago

Hmm I haven't explicitly added any typescript support so I assume it isn't getting through Bookshop's loaders. I'll look into this, it should be possible 🙂