From 5b54d323b9e8de247afc73900bf952156dbaee84 Mon Sep 17 00:00:00 2001 From: Axetroy Date: Thu, 17 Jan 2019 01:16:28 +0800 Subject: [PATCH] fix: incorrect output memory file path (#225) --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 39767add..8815d31d 100644 --- a/src/index.js +++ b/src/index.js @@ -295,8 +295,8 @@ module.exports = ( getFlatFiles(mfs.data, assets, assetState.assetPermissions); delete assets[filename]; delete assets[filename + ".map"]; - let code = mfs.readFileSync("/index.js", "utf8"); - let map = sourceMap ? mfs.readFileSync("/index.js.map", "utf8") : null; + let code = mfs.readFileSync("/" + filename, "utf8"); + let map = sourceMap ? mfs.readFileSync("/" + filename + ".map", "utf8") : null; if (minify) { const result = terser.minify(code, {