Skip to content

Migration to ESBuild #8

@leovigna

Description

@leovigna

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions