ElMassimo / ElMassimo/vite-plugin-image-presets

[Feature Request] Default preset

Open
#9 1 comment 4 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
264
Forks
8
PR merge metrics
No merged PRs in 30d

Description

It would be nice if there were a way to specify a default preset so every import didn't need the query string.

Maybe something like this...
```js
imagePresets({
'default': widthPreset({
widths: [425, 1024, 1200],
formats: {
webp: { quality: 100 },
png: { quality: 100 }
}
})
}),
```

Or this...
```js
imagePresets({
'foobar': widthPreset({
default: true,
widths: [425, 1024, 1200],
formats: {
webp: { quality: 100 },
png: { quality: 100 }
}
})
}),
```

Great plugin btw 👍 It's saved me a lot of time already.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the imagePresets configuration and the handling of imports that include a query string. Compare the two proposed default-preset approaches and define how an import without a query should select the default; done means such imports use the configured preset while explicit query strings continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.