The current library only supports working in ESM environments.
As firebase itself supports CJS environments, it'd be unfair to ignore it.
This issue is for feedback/discussion of the implementation.
Current State
Keep the library ESM first but compatible with CJS. Users can use async imports (await import("@nearform/playwright-firebase")) but I think we should still provision the general user
Possible Changes
Add another tsc compile step for CJS builds
Add in a esm folder and esm/package.json with "type":"module" to isolate
Add in exports to the root package.json to make sure general resolvers understand where to look
Change main to point to the dist folder
Make sure exports point to the esm folder for generic(default) rules as well
The current library only supports working in ESM environments. As firebase itself supports CJS environments, it'd be unfair to ignore it.
This issue is for feedback/discussion of the implementation.
Current State
Keep the library ESM first but compatible with CJS. Users can use async imports (
await import("@nearform/playwright-firebase")
) but I think we should still provision the general userPossible Changes
tsc
compile step for CJS buildsesm
folder andesm/package.json
with"type":"module"
to isolateexports
to the rootpackage.json
to make sure general resolvers understand where to lookmain
to point to thedist
folderexports
point to theesm
folder for generic(default
) rules as well