check that asset.map is a function before call it
check that asset.map is a function before call it

Some assets do not have .map() method.
Here https://github.com/kevlened/copy-webpack-plugin/blob/a59ba168a4d46bd5a1c82fddac6b6ee6452d7799/src/writeFile.js#L84-L91 plugin adds new assets that have only .source() and .size() methods. They cause errors when precessed with EncodingPlugin.
quackes/webpack-encoding-plugin