Using
npm: 8.4.0
webpack: 5.52.1
fontmin-webpack: 3.2.0
I set up FontminPlugin in my webpack project as per its documentation (following reduced to minimal setup):
const FontminPlugin = require('fontmin-webpack');
module.exports = {
entry: 'my-entry.js',
output: {
// ...
},
plugins: [
// ...
new FontminPlugin({
autodetect: true
})
],
}
I get the following TypeError when running my webpack build:
$ npm run build
> myproject@1.0.0 build
> webpack
myproject/node_modules/fontmin-webpack/lib/index.js:117
const matches = content.match(GLYPH_REGEX) || []
^
TypeError: content.match is not a function
at myproject/node_modules/fontmin-webpack/lib/index.js:117:33
at arrayMap (myproject/node_modules/lodash/lodash.js:653:23)
at Function.map (myproject/node_modules/lodash/lodash.js:9622:14)
at interceptor (myproject/node_modules/lodash/lodash.js:17094:35)
at Function.thru (myproject/node_modules/lodash/lodash.js:8859:14)
at myproject/node_modules/lodash/lodash.js:4430:28
at arrayReduce (myproject/node_modules/lodash/lodash.js:697:21)
at baseWrapperValue (myproject/node_modules/lodash/lodash.js:4429:14)
at LodashWrapper.wrapperValue (myproject/node_modules/lodash/lodash.js:9114:14)
at FontminPlugin.findUnicodeGlyphs (myproject/node_modules/fontmin-webpack/lib/index.js:138:8)
Using
I set up
FontminPluginin my webpack project as per its documentation (following reduced to minimal setup):I get the following
TypeErrorwhen running my webpack build: