Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to ESBuild #8

Open
leovigna opened this issue Jun 17, 2022 · 0 comments
Open

Migration to ESBuild #8

leovigna opened this issue Jun 17, 2022 · 0 comments

Comments

@leovigna
Copy link

Description
Migrate to using ESBuild for transpiling the library. I've already created a branch https://github.com/leovigna/indexeddb-orm/tree/version/4.0-esbuild and would like to know if you're interested in a PR to merge some of the changes.

ORM version: (check one with "x")
[ ] 1.x
[ ] 2.x
[x] 4.x

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, instead use WordPress forums

Tell about your platform

  • Operating System : Linux
  • Browser and version: NA

Current behavior
Typescript is transpiled to js using tsc as an ESM Library. I suggest migrating over to esbuild to easily support various output formats:

  • ESM Library
  • CommonJS Library
  • ESM Bundle
  • CommonJS Bundle

This makes the library easily bundled in web projects regardless of whether they are ESM or CommonJS. Types are generated with tsc.

Expected behavior
ESBuild creates 4 outputs:

  • /lib/esm
  • /lib/cjs
  • /dist/esm
  • /dist/cjs

Steps to reproduce:
See the branch here and run npm build.
https://github.com/leovigna/indexeddb-orm/tree/version/4.0-esbuild

Note I have also commented out the global idb overrides in index.ts as it causes issues when looking to use indexed-db in NodeJS for testing purposes. (I use it alongside https://github.com/dumbmatter/fakeIndexedDB).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant