Skip to content

Commit

Permalink
fix input.js file entries in source maps
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pirxpilot committed Aug 21, 2018
1 parent 7e13064 commit 1781b03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1781b03

Please sign in to comment.