diff --git a/src/lib/Image.svelte b/src/lib/Image.svelte new file mode 100644 index 0000000..e7cfb65 --- /dev/null +++ b/src/lib/Image.svelte @@ -0,0 +1,53 @@ + + +{#snippet img(src: string)} + +{/snippet} + +{#if src.startsWith('http')} + {@render img(src)} +{:else} + {@const enhancedSrc = importImage(src)} + {#if enhancedSrc != null} + + {:else} + {@render img(src)} + {/if} +{/if}