egoist / poi

⚡A zero-config bundler for JavaScript applications.
https://poi.js.org
MIT License
5.23k stars 255 forks source link

webp should be treated as a img #465

Closed iulo closed 6 years ago

iulo commented 6 years ago

Do you want to request a feature or report a bug? bug

What is the current behavior? poi think of webp as img If the current behavior is a bug, please provide the steps to reproduce. https://github.com/egoist/poi/blob/d48ea57e08c2b297800c58ca95459dcf04c8c593/packages/core/rules/font.js#L2-L9

What is the expected behavior? webp should be treated as a img If this is a feature request, what is the motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, Poi version and Operating System.

egoist commented 6 years ago

Should webp be treated as a normal image? If so you can make a change to https://github.com/egoist/poi/blob/master/packages/core/rules/image.js and create a PR.

iulo commented 6 years ago

@egoist
BTW, just clone poi project, try the test case, failed on win10 but passed on mac.

iulo commented 6 years ago

@egoist Hi, i found you have moved https://github.com/egoist/poi/blob/master/packages/core/rules/image.js to https://github.com/upash/poi/blob/master/packages/poi/lib/webpack/rules/images.js. But the webp extname still inlcude in font rule ,no image rule. Should I make a change and create a PR, or you fix it by yourself ?

egoist commented 6 years ago

@iulo sure, PR would be neat

egoist commented 6 years ago

OK I fixed this myself, technically this is not a bug since .webp was loaded with file-loader which is fine I think.