Railgun-Community / waku-broadcaster-client

MIT License
1 stars 3 forks source link

include file extensions in all ESM imports #8

Closed staltz closed 1 year ago

staltz commented 1 year ago

Context

Fixes issue #7, i.e. when using waku-relayer-client in Node.js without any bundler (or with a bundler set up with specific configurations).

Problem

Waku is exported only in ESM, not CommonJS, so this forces waku-relayer-client to be ESM-only too. When that's the case, we are actually using ESM incorrectly, because we have to import { foo } from './foo.js not import { foo } from './foo'.

Solution

This PR adds file extensions to all ESM imports, and tweaks the tsconfig.json accordingly.

Tests