diff --git a/lib/index.js b/lib/index.js index 93a12da4..1b6ea48e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -5,4 +5,8 @@ * * Copyright 2010-2021 Digital Bazaar, Inc. */ -module.exports = require('./jsonld'); +const platform = require('./platform'); +const jsonld = require('./jsonld'); +platform.setupGlobals(jsonld); +platform.setupDocumentLoaders(jsonld); +module.exports = jsonld; diff --git a/lib/jsonld.js b/lib/jsonld.js index c6931aeb..5a24944c 100644 --- a/lib/jsonld.js +++ b/lib/jsonld.js @@ -34,7 +34,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ const canonize = require('rdf-canonize'); -const platform = require('./platform'); const util = require('./util'); const ContextResolver = require('./ContextResolver'); const IdentifierIssuer = util.IdentifierIssuer; @@ -1024,9 +1023,6 @@ jsonld.RequestQueue = require('./RequestQueue'); /* WebIDL API */ jsonld.JsonLdProcessor = require('./JsonLdProcessor')(jsonld); -platform.setupGlobals(jsonld); -platform.setupDocumentLoaders(jsonld); - function _setDefaults(options, { documentLoader = jsonld.documentLoader, ...defaults diff --git a/package.json b/package.json index facc56b5..381f1682 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ ] }, "browser": { - "./lib/index.js": "./lib/jsonld.js", + "./lib/index.js": "./lib/index.js", "./lib/platform.js": "./lib/platform-browser.js", "crypto": false, "http": false,