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

Add ESM and rollup build #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hugo-vrijswijk
Copy link

@hugo-vrijswijk hugo-vrijswijk commented Nov 20, 2024

First of all, thanks for this awesome library!

Fixes #94

Adds a rollup config file to build ESM, CJS, and UMD bundles. Based on the source in src/fuzzysort.js.

Checks in the new esm file and the updated cjs and umd files.

Also updates the package.json to include module and browser fields for the ESM and UMD bundles. This lets bundlers, node or CDN's know which version to use.

I've tried to keep things fairly streamlined. Running 'test' automatically builds the files. The src/fuzzysort.js and fuzzysort.mjs files are extremely similar, but that seemed better than the confusion of knowing which file in the root to edit and having rollup potentially overwrite your changes. I've also kept the build files checked in, to keep things simple. A nice future improvement I'm willing to contribute would be github actions CI and creating a PR when the files drift?

Fixes farzher#94

Adds a rollup config file to build ESM, CJS, and UMD bundles. Based on the source in src/fuzzysort.js.

Checks in the new esm file and the updated cjs and umd files.

Also updates the package.json to include `module` and `browser` fields for the ESM and UMD bundles.
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

Successfully merging this pull request may close these issues.

Deno/ESM support
1 participant