JonasKruckenberg / imagetools

Load and transform images using a toolbox :toolbox: of custom import directives!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in `include` default value

ncvc opened this issue · comments

I think the default include option has a bug. Currently, the value is ['**\/*.{heic,heif,avif,jpeg,jpg,png,tiff,webp,gif}', '**\/*.{heic,heif,avif,jpeg,jpg,png,tiff,webp,gif}?*'], but it I think should be ['**\/*.{heic,heif,avif,jpeg,jpg,png,tiff,webp,gif}', '**\/*.{heic,heif,avif,jpeg,jpg,png,tiff,webp,gif}\\?*'] (note the \\ before the ? in the 2nd path).

The current value will match URLs like http://localhost:3000/some/non/image/path?extension=.jpg&sort=desc and throw an error, since the ? is a wildcard if not escaped (ref)

Taking another look, the include values may need to be specified as regexes until this bug in @rollup/pluginutils is fixed: rollup/plugins#1430