When the output.publicPath is a function, this plugin will throw an error saying TypeError: webpackPublicPath.trim is not a function, I found that this error was from here, it didn't handle the situation that output.publicPath is a function, so the webpackPublicPath.trim() call failed.
According to the documentation from Webpack, output.publicPath can be a string or a function.