patrickhulce / fontmin-webpack

Minifies icon fonts to just the used glyphs.
MIT License
139 stars 19 forks source link

Webpack 5 support #32

Closed choule99 closed 3 years ago

choule99 commented 3 years ago

Hi!

I am looking at upgrading to Webpack 5, and it seems to me that the plugin is not compatible with WebPack 5 due to some API changes in WebPack (I am not familiar really with the intricacies of nodejs, or webpack for that matter).

Here is an example stack I get:

TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at Function.from (<anonymous>)
    at /project_root/node_modules/fontmin-webpack/lib/index.js:47:32
    at arrayMap (/project_root/node_modules/lodash/lodash.js:639:23)
    at Function.map (/project_root/node_modules/lodash/lodash.js:9580:14)
    at interceptor (/project_root/node_modules/lodash/lodash.js:17046:35)
    at Function.thru (/project_root/node_modules/lodash/lodash.js:8817:14)
    at /project_root/node_modules/lodash/lodash.js:4388:28
    at arrayReduce (/project_root/node_modules/lodash/lodash.js:683:21)
    at baseWrapperValue (/project_root/node_modules/lodash/lodash.js:4387:14)
    at LodashWrapper.wrapperValue (/project_root/node_modules/lodash/lodash.js:9072:14)

Using Webpack 5.3.0 at the moment, but I assume the breaking changes occured when the 5.x branch got released.

patrickhulce commented 3 years ago

Thanks for filing @choule99! I haven't tried it out on webpack 5 so that's very possible :)

I'll take a whack at it this weekend.

patrickhulce commented 3 years ago

fixed by https://github.com/patrickhulce/fontmin-webpack/commit/5220f705694d4b609100ef6a20657c2d176c16ca