Going pure ESM 🚀 #1868
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 ? |
Beta Was this translation helpful? Give feedback.
-
Hello people!
As the world moves towards ESM, I suggest we move the
class-validator
to pure ESM.We already have a dependency that is now only available for ESM.
libphonenumber-js
from v1.10. Hopefully,validator.js
also goes ESM at some point.Read more here:
https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
Beta Was this translation helpful? Give feedback.
All reactions