Closed budarin closed 1 year ago
Hi @budarin - You're right that currently ulidx is packaged as CJS, and this makes it impossible for webpack to treeshake.
Instead of providing a build where the output is just the source code, I would suggest that I support ECMAScript modules. I'd need to make sure that both the CJS and ESM builds can work together in the same package. I don't think publishing the Typescript source is a nice solution, I'd prefer to have to compiled to JS but retaining the module import/export approach.
That being said, I will look at the original ulid
package to get some ideas on the different publishing options. That package has been around for a while and has had to serve a lot of different use cases, so I'll try to add compatibility on that front also.
This would be great if it was tree shakeable .
Can anyone help assist in this?
Currently working on an ESM-only build, which will probably be released as v1. It should be ready soon.
ESM+CJS now available in v1
I use only one method, but webpack could not do tree shaking on built common module - so the full package code is included in my app instead of some functions