From 70c401d1436399df01c94f83cec28e0e48c7972e Mon Sep 17 00:00:00 2001 From: Lindsey Date: Thu, 29 Mar 2018 16:48:00 -0400 Subject: [PATCH] Handle asset source being a buffer, not a string I am still trying to track down _why_ this happens, but when doing a production build `source()` returns a `Buffer` instead of a string. It seems to be fine in development, so my intuition is that it's minification related, but I haven't been able to isolate exactly which option. Changing `mode`, disabling the Uglify plugin - nothing seems to alter how this works in a production build. --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 4529f00..3ae11aa 100644 --- a/index.js +++ b/index.js @@ -25,8 +25,9 @@ InlineManifestPlugin.prototype.apply = function (compiler) { })[0] || {files: []}).files[0]; if (manifestPath) { + const source = sourceMappingURL.removeFrom(compilation.assets[manifestPath].source().toString()); webpackManifest.push(''); const manifestIndex = assets.js.indexOf(assets.publicPath + manifestPath);