Vee-validate: Minimal bundle size same as normal one

Created on 5 Feb 2019  路  8Comments  路  Source: logaretm/vee-validate

Versions

  • vee-validate: 2.1.7
  • vue: 2.6.2

Description
I want to install the minimal bundle of VeeValidate as described in the docs. But it has almost no effect on the bundle size after the build process (it has +1 KB compared to the bundle size after using the normal import described in the Getting Started section in the docs).

To reproduce

Minimal bundle installation:

import { Validator, install as VeeValidate } from 'vee-validate/dist/vee-validate.minimal.esm.js'
import { required } from 'vee-validate/dist/rules.esm.js'
import veeEn from 'vee-validate/dist/locale/en'
Validator.extend('required', required)
Validator.localize('en', veeEn)
Vue.use(VeeValidate)

... takes up 98.3 KB in my build file. Also my build files are the same size after normal/minimal import of VeeValidate.

Expected behavior
A smaller bundle size of VeeValidate.

Windows 10
Parcel 1.11.0 (for build process)
node 10.15.1

馃悰 bug

Most helpful comment

vee-validate is out, checkout the size improvements here: https://bundlephobia.com/[email protected]

All 8 comments

I can confirm this behaviour (same version of vee-validate). It seems the bundle includes both the full build and the minimal build.

In a uglyfied build, the minimal bundle grows about 40KB in size using only 'de' localization and 4 simple rules (length, numeric, email and required).

Could we get a comment about this please? See attached webpack analyzer.

image

Issue still persists. It added ~322kb to my form component.

I built a tool to help you analyze webpack bundles for size regressions, and report them directly to GitHub PRs. It's free for open source, so it might be worth checking out and helpful in this scenario.

https://packtracker.io

image

Has there been any movement on this?

I need solution too,
have any plans to improve bundle size ?

Addressed here #2191

vee-validate is out, checkout the size improvements here: https://bundlephobia.com/[email protected]

Was this page helpful?
0 / 5 - 0 ratings