Skip to content

Fix ESM#5

Merged
cmdcolin merged 3 commits intomainfrom
fix_esm
May 25, 2025
Merged

Fix ESM#5
cmdcolin merged 3 commits intomainfrom
fix_esm

Conversation

@cmdcolin
Copy link
Copy Markdown
Contributor

In 5d920d2 we had to revert the ESM-ness of the build back to CJS. This restores it

Larger context

Other ESM modules have trouble importing CJS modules which this module, as noted above, was converted to. This continues on as an ESM

@cmdcolin
Copy link
Copy Markdown
Contributor Author

More technical details:

We have a number of 'business needs' including

  1. making a modern simple package
  2. making our package work in jbrowse-web and other contexts, which does not use LocalFile (node.js fs package)
  3. making our package work in jbrowse-desktop, which does use LocalFile (node.js fs package)
  4. making our package work with our other data parsers in whatever context that people might use them
  5. making our package work in jest, which tends to like commonjs

@cmdcolin cmdcolin merged commit 7421a81 into main May 25, 2025
1 check passed
@cmdcolin cmdcolin deleted the fix_esm branch May 25, 2025 23:25
@cmdcolin
Copy link
Copy Markdown
Contributor Author

reverted because of odd build errors in vite embedded "document.head not defined"

@cmdcolin
Copy link
Copy Markdown
Contributor Author

actually managed to make work in v2.0.6

@cmdcolin
Copy link
Copy Markdown
Contributor Author

there are various challenges with embedded usage, where it complains about use of fs/promises because the LocalFile exclude doesn't work. could revert if it is really troublesome...

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.

1 participant