Skip to content

Commit

Permalink
fix(vite-imagetools): Add a more helpful error message when no images…
Browse files Browse the repository at this point in the history
… could be generated during dev mode
  • Loading branch information
JonasKruckenberg committed Apr 24, 2021
1 parent 54d0c1b commit e62b1bb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ export function imagetools(userOptions: Partial<PluginOptions> = {}): Plugin {

const image = generatedImages.get(id)

if(!image) throw new Error(`vite-imagetools cannot find image with id "${id}" this is likely an internal error`)

if (pluginOptions.removeMetadata === false) {
image.withMetadata()
}
Expand Down

0 comments on commit e62b1bb

Please sign in to comment.