poppinss / indicative

Indicative is a simple yet powerful data validator for Node.js and browsers. It makes it so simple to write async validations on nested set of data.
https://indicative.adonisjs.com/
MIT License
417 stars 52 forks source link

Provide es modules build #168

Closed vladshcherbin closed 5 years ago

vladshcherbin commented 6 years ago

Currently, umd format is used. Since you are using rollup, it'll be great if es output format would be added for possible tree-shaking optimisations.

thetutlage commented 6 years ago

100%, is there any convention that everyone agree on. Like rollup uses the module field from package.json file to use the es6 module ( if exists ). Is it same for webpack?

vladshcherbin commented 6 years ago

@thetutlage yes, according to docs module field is resolved before main if exists.

thetutlage commented 6 years ago

Cool, lemme add it

thetutlage commented 6 years ago

Want to try it from Github and lemme know if all works fine.

I tried creating a simple example and build size dropped from 32KB -> 10KB. But feel free to share if more optimizations can be done. ( I am not much active with build tools these days )

vladshcherbin commented 6 years ago

@thetutlage I believe the format should be set to es instead of cjs for es modules.

RomainLanz commented 6 years ago

Yes, also no need to uglify and minify the bundle.

thetutlage commented 5 years ago

Closing, since the newer releases are not focused on browsers anymore