Skip to content

Commit

Permalink
fix: 🐛 remove '?srcset' from id before attempting to find config
Browse files Browse the repository at this point in the history
  • Loading branch information
DerZade committed Feb 7, 2024
1 parent 8241856 commit 2fa3ad8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ export default function srcsetPlugin(options: SrcsetPluginConfig = []): Plugin {
async load(id) {
if (!id.endsWith(SUFFIX)) return null;

const config = findConfig(id);

const idWithoutParams = new URL(id, import.meta.url).pathname;

const config = findConfig(idWithoutParams);

if (viteCommand === 'serve') {
// we just serve the image during dev server operation
return {
Expand Down

0 comments on commit 2fa3ad8

Please sign in to comment.