From 1781b03b5b447052e04d46a2edc4d6f8dc3c1207 Mon Sep 17 00:00:00 2001 From: Damian Krzeminski Date: Tue, 21 Aug 2018 11:53:20 -0600 Subject: [PATCH] fix `input.js` file entries in source maps Pass `inputFilename` to static module to make it insert proper file name into generated source map. Without this change we end up with 'input.js' (which is the default file name) as the basename of affected files in the resulting source maps. see also: browserify/common-shakeify#16 --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 18a1ea7..5ca9cec 100644 --- a/index.js +++ b/index.js @@ -34,7 +34,8 @@ module.exports = function (file, opts) { vars: vars, varModules: { path: path }, parserOpts: opts && opts.parserOpts, - sourceMap: opts && (opts.sourceMap || opts._flags && opts._flags.debug) + sourceMap: opts && (opts.sourceMap || opts._flags && opts._flags.debug), + inputFilename: file } ); return sm;