Skip to content

Use import instead of require for dependencies #160

@jmrog

Description

@jmrog

Currently, we import using CommonJS syntax: const whatever = require('whatever');. This actually creates issues in some cases for consumers of stardog.js who also use webpack, since one of our transitive dependencies (node-fetch) uses ES modules, and webpack prefers ES modules when they're available, with the result that our require imports an object with a default property if stardog.js gets bundled by webpack (see this issue and especially this comment, as well as this issue. There are workarounds, but they're inconvenient, and there's probably no other compelling reason not to just use import anyway, so we should consider switching over for v2.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions