Vanilagy / webm-muxer

WebM multiplexer in pure TypeScript with support for WebCodecs API, video & audio.
https://vanilagy.github.io/webm-muxer/demo
MIT License
197 stars 12 forks source link

Provide package as ESM module #23

Closed davidstrahm closed 11 months ago

davidstrahm commented 1 year ago

This package causes warnings in Angular compiler because it uses commonJs modules instead of ESM modules, also, its not treeshakeable.

See: https://gist.github.com/aelbore/65a4d2e86c3326f36607db111a7b6887

Vanilagy commented 1 year ago

Technically my module is in UMD, since I wanted it to work both as a regular script import and in Node. But you're correct, providing an additional build in ESM provides additional benefits, such as tree-shakability. I also personally prefer ESM, but decided to author my library in CJS for maximum compatibility.

I'll look into how to author this lib in both formats!

Vanilagy commented 11 months ago

Included a native ESM bundle in the latest version, please verify!