Validator.js: Custom front-end builds

Created on 23 May 2016  路  3Comments  路  Source: validatorjs/validator.js

For minimizing the footprint client-side, it would be helpful to be able to build a custom "build" of validator.js with just the specific validators my application needs (e.g. isEmail and isURL).

I haven't tried this, but perhaps it's as simple as commenting out some lines in src/index.js and running npm build:browser? Regardless, would be nice to see specific documented instructions for this.

epic help wanted

Most helpful comment

Validator.js might be too small for this, but you could look at what lodash is doing: https://lodash.com/custom-builds

All 3 comments

I haven't look at this at all. It'd be nice to have a custom build system where you could pick and choose the functions you need, but it's a lot of work to setup and maintain. PRs are of course welcome :smile:

I'm using ES6 to import the validators/sanitizers I need for the current module, this greatly helps in minimizing the footprint, and also kudos to @chriso for making this available :smile:
For ES6 -> ES5 We use browserify.

Validator.js might be too small for this, but you could look at what lodash is doing: https://lodash.com/custom-builds

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mum-never-proud picture mum-never-proud  路  4Comments

Maxreglez picture Maxreglez  路  3Comments

rathboma picture rathboma  路  4Comments

frontendmonster picture frontendmonster  路  4Comments

mfbx9da4 picture mfbx9da4  路  4Comments