Vee-validate: New "minimal builds" (import Rules) don't seem to work

Created on 22 Sep 2017  路  4Comments  路  Source: logaretm/vee-validate

Versions:

  • VueJs: 2.4.4
  • Vee-Validate: 2.0.0-rc.17
  • Version 63.0.3219.0 (Official Build) canary (64-bit)

Description:

Described in rc15 is a way to import single rules to keep the build small. This doesn't seem to work.

Steps To Reproduce:

Using the description given in the docs:

import Vue from 'vue';
import VeeValidate from 'vee-validate/dist/vee-validate.minimal';
import { Rules } from 'vee-validate';

Vue.use(VeeValidate);

// add the required rule
VeeValidate.Validator.extend('required', Rules.required);

I get this in the console:

"export 'Rules' was not found in 'vee-validate'

It could be that something in my code is wrong. I tried to find soem sort of export statement in the vee-validate.js which might export Rules in a way but couldn't find any. But that could also be caused by my misunderstanding of the codebase.

If this is working fine for anyone in here just close this issue please and I will dig into a bit more on my side.

馃悰 bug

Most helpful comment

Thanks for reporting this, This is a bug caused by Rules not being exported correctly by the plugin, Should be released in the next version. Sorry about that, I will release a quick fix today or tomorrow.

All 4 comments

Thanks for reporting this, This is a bug caused by Rules not being exported correctly by the plugin, Should be released in the next version. Sorry about that, I will release a quick fix today or tomorrow.

When are this fix planned to be deployed?

@vfportero this is already fixed, we are using it in our current project, see:
https://github.com/baianat/vee-validate/releases/tag/2.0.0-rc.18

@escapedcat I'm using typescript and the Rules object is not being declared on the vee-validate.d.ts file. The only way to make it work is using the Validator.rules object and making a cast:

(Validator.rules as any).email(value.trim()) //Validates the email trimmed

Was this page helpful?
0 / 5 - 0 ratings