Skip to content

Commit 1781b03

Browse files
committed
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
1 parent 7e13064 commit 1781b03

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ module.exports = function (file, opts) {
3434
vars: vars,
3535
varModules: { path: path },
3636
parserOpts: opts && opts.parserOpts,
37-
sourceMap: opts && (opts.sourceMap || opts._flags && opts._flags.debug)
37+
sourceMap: opts && (opts.sourceMap || opts._flags && opts._flags.debug),
38+
inputFilename: file
3839
}
3940
);
4041
return sm;

0 commit comments

Comments
 (0)