Repository navigation
Going pure ESM 🚀 #1868
simenandre
started this conversation in
Feature Ideas
Replies: 1 comment
|
Hello, about class-validator usage inside pure ESM build, Trying to migrate to Node 20 with pure ESM build. Major issue: class-validator defaulting to ./cjs build. If using direct import like class-validator/esm2015/index.js - the package do not have "type":"module" so it's CommonJS. Tried to use RollUp commonJS to ESM converter plugin - no luck. Tried to use Babel decorators plugin - if setting the newest proposal - getting runtime error (because class-validator defaulting to use its' ./cjs build), if setting "legacy":true - build becomes incompatible with pure ESM. Form all my experiments I would assume package is not usable with ESM or am I missing something ? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello people!
As the world moves towards ESM, I suggest we move the
class-validatorto pure ESM.We already have a dependency that is now only available for ESM.
libphonenumber-jsfrom v1.10. Hopefully,validator.jsalso goes ESM at some point.Read more here:
https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
All reactions