diff --git a/lib/encoding.js b/lib/encoding.js index 2ec7414..b5c8904 100644 --- a/lib/encoding.js +++ b/lib/encoding.js @@ -6,9 +6,9 @@ * @fileoverview Global |this| required for resolving indexes in node. * @suppress {globalThis} */ -if (typeof module !== "undefined" && module.exports) { - this["encoding-indexes"] = - require("./encoding-indexes.js")["encoding-indexes"]; +if (typeof module !== "undefined" && module.exports && + !this["encoding-indexes"]) { + require("./encoding-indexes.js"); } (function(global) {