Vee-validate: [nuxt] v-validate size into bundle

Created on 13 Apr 2018  Â·  4Comments  Â·  Source: logaretm/vee-validate

Versions:

  • VueJs: 2.5.16
  • Vee-Validate: 2.0.6
  • Nuxt.js (nuxt-edge): 2.0.0-25387804.c1d14f5

Description:

v-validate size into nuxt bundle is quite big (192.61KB), even though I followed the recommended injection method, but still:
image

Steps To Reproduce:

repro-link

yarn build -a
✨ enhancement

Most helpful comment

I will create a separate bundle for validation rules which should be
helpful in the future.

All 4 comments

>
>

This is not an issue, vee-validate does a lot of things, has bunch of
features. You could use the minimal build instead which is smaller but you
would need to add the rules you need yourself, since it doesn't have
anything but the core functionality.

You can import it from 'dist/vee-validate.minimal.esm.js'

I'm actively looking for a way to get the size down. But that would require
modular approach which is breaking for the current API. Maybe In the next
major version.

>

You can import it from 'dist/vee-validate.minimal.esm.js'

@logaretm thanks for the tip!
Should I import each rule from src directly into the dedicated plugin with an extend:

VeeValidate.Validator.extend(...)

or is there a way to add rules only in required components/pages in here (nothing related in the doc):

$_veeValidate: {
  validator: 'new' // give me a new validator each time.
},

Ok, I've just got the answer to my question: I'd literally need to add the rules code into my project myself

I will create a separate bundle for validation rules which should be
helpful in the future.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saintplay picture saintplay  Â·  3Comments

schel4ok picture schel4ok  Â·  3Comments

yyyuuu777 picture yyyuuu777  Â·  3Comments

7immer picture 7immer  Â·  3Comments

parweb picture parweb  Â·  3Comments