We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce6eafe commit 48d7b0aCopy full SHA for 48d7b0a
1 file changed
source-map-support.js
@@ -560,12 +560,12 @@ exports.install = function(options) {
560
561
// Redirect subsequent imports of "source-map-support"
562
// to this package
563
- const originalRequire = Module.prototype.require;
564
- Module.prototype.require = function requireProxy(id) {
565
- if (id === 'source-map-support') {
566
- id = '@cspotcode/source-map-support';
+ const originalResolveFilename = Module._resolveFilename;
+ Module._resolveFilename = function resolveFilenameProxy(...args) {
+ if (args[0] === 'source-map-support') {
+ args[0] = '@cspotcode/source-map-support';
567
}
568
- return originalRequire.call(this, id);
+ return originalResolveFilename.call(this, ...args);
569
570
571
// Allow sources to be found by methods other than reading the files
0 commit comments