Skip to content

Commit

Permalink
fix(utils): fix warning thrown by Webpack (#2843)
Browse files Browse the repository at this point in the history
Fixes a warning thrown by Webpack for using "require" without importing
anything. Warning reads "require function is used in a way in which
dependencies cannot be statically extracted"

Closes issue #2840
  • Loading branch information
istateside authored and straker committed Apr 1, 2021
1 parent ca8c2c7 commit df5d01b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/core/utils/uuid.js
Expand Up @@ -24,10 +24,10 @@ if (!_rng && _crypto && _crypto.getRandomValues) {
}

try {
if (!_rng && require) {
const nodeCrypto = require('crypto');
_rng = () => nodeCrypto.randomBytes(16);
}
if (!_rng) {
const nodeCrypto = require('crypto');
_rng = () => nodeCrypto.randomBytes(16);
}
} catch (e) {
/* do nothing */
}
Expand Down

0 comments on commit df5d01b

Please sign in to comment.