Skip to content

Commit

Permalink
Merge pull request #273 from evanw/dynamic-require-module
Browse files Browse the repository at this point in the history
Use dynamicRequire to import 'module'
  • Loading branch information
LinusU authored Apr 24, 2020
2 parents 282a3f8 + 619bcc0 commit d630e43
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions source-map-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,8 @@ exports.install = function(options) {

// Support runtime transpilers that include inline source maps
if (options.hookRequire && !isInBrowser()) {
var Module;
try {
Module = require('module');
} catch (err) {
// NOP: Loading in catch block to convert webpack error to warning.
}
// Use dynamicRequire to avoid including in browser bundles
var Module = dynamicRequire(module, 'module');
var $compile = Module.prototype._compile;

if (!$compile.__sourceMapSupport) {
Expand Down

0 comments on commit d630e43

Please sign in to comment.