Releases: zerodevx/svelte-img
Releases · zerodevx/svelte-img
v2.1.2
v2.1.1
v2.1.0
- Add support for multiple profiles (#33)
- Deprecate
runDefaultDirectives
but still works for backward compatibility
Define profiles in vite.config.js
:
// `runDefaultDirectives` is deprecated; use `profiles` instead
...
plugins: [
sveltekit(),
imagetools({
profiles: {
// override defaults
run: new URLSearchParams('w=640;1280&format=webp;jpg'),
// add new profile(s)
new1: new URLSearchParams('w=320&h=320&fit=cover&format=png'),
new2: new URLSearchParams('w=640;1280&format=webp;jpg')
}
})
]
Invoke profile in app:
import src1 from '$lib/a/1.jpg?as=new1'
import src2 from '$lib/a/2.jpg?as=new2'
v2.0.3
v2.0.2
v2.0.1
v2.0.0
High-performance responsive/progressive images for SvelteKit.
v2
has landed, and it's more optimised than ever! 🥳
First, a little background. v1
was originally developed to address issues with vite-imagetools
, like how:
- inline directives are merged with default directives, instead of overriding them as expected;
- there's no easy way to create a
<picture>
tag; - and there's no easy way to generate a
base64
LQIP.
Fixing these required a tonne of patching. However, with the v5
release of imagetools (and the merge of this PR), svelte-img
can be refactored to work the right way. Benefits include:
- handling more work at build step;
- leading to faster component rendering;
- and a much smaller payload (build size).
So please migrate.
BREAKING CHANGES:
?run
is deprecated; replace with?as=run
when importing images.run
default directives are defined using therunDefaultDirectives
key now.?lqip={number}
is deprecated; replace with?as=run:{number}
.?width={number}
and?height={number}
are deprecated; use?w={number}
and?h={number}
instead.- Exposed CSS vars for
FxReveal
have changed. - If you're using
svelte-img
with an external image API, thesrc
meta data structure has changed; it is now in parity with imagetools' native?as=picture
output format.