Skip to content

Commit

Permalink
Fix exports
Browse files Browse the repository at this point in the history
  • Loading branch information
zerodevx committed Aug 25, 2022
1 parent 187f550 commit eff4e55
Show file tree
Hide file tree
Showing 8 changed files with 506 additions and 45 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Add `imagetools` plugin into your `vite.config.js`:

```js
import { sveltekit } from '@sveltejs/kit/vite'
import { imagetools } from '@zerodevx/svelte-img'
import { imagetools } from '@zerodevx/svelte-img/vite'

/** @type {import('vite').UserConfig} */
const config = {
Expand All @@ -35,13 +35,13 @@ Use anywhere in your Svelte app:
<script>
// Import original max-sized image with `?run` query param.
import cat from '$lib/assets/cat.jpg?run'
import { Img } from '@zerodevx/svelte-img'
import Img from '@zerodevx/svelte-img'
</script>

<Img class="any classes" src="{cat}" alt="Cute cat" />
```

The `<Img>` tag renders into:
The image component renders into:

```html
<picture>
Expand All @@ -59,7 +59,7 @@ The `<Img>` tag renders into:
srcset="path/to/jpg/480 480w, path/to/jpg/1024 1024w, path/to/jpg/1920 1920w"
loading="lazy"
decoding="async"
style='background: url("data:image/webp;base64,UklGRmwAAABXRUJQVlA4IGAAAADwAQCdASoQAAwABUB8JbACdACVHAuzHEAA+FXw/vPuIDGE/UU8XBsY0aVUcxdGEcG5CngK2JQO7wxCmgwPJrlpw4REDWFeMX1yfLUHBxkTmnPYhBDAP1QyVOF7EB/AAAA=") no-repeat center/cover'
style='background: url("data:image/webp;base64,XXX") no-repeat center/cover'
alt="Cute cat"
/>
</picture>
Expand Down
Loading

0 comments on commit eff4e55

Please sign in to comment.