rubystarashe / nuxt-vuex-localstorage

MIT License
161 stars 18 forks source link

This library increases my project size by almost 1 megabyte! #23

Closed simplenotezy closed 3 years ago

simplenotezy commented 4 years ago

When I pull in this dependency the project size increases from 2.56mb to 3.35mb - that's quite a lot. It seems to be related to the dependency on "crypto".

See an example below.

Without vuex-localstorage: image

With vuex-localstorage: image

TanguyAladenise commented 4 years ago

Hi there,

I'm having the exact same issue. Adding the library without doing anything special except including it my modules in Nuxt.config.js, makes my app package a lot bigger.

It seems to be related to WebPack somehow, bundling itself...? when using the library.

At first I was looking why I had so many occurrences of bn.js file and it lead me to this library. FYI the tree of dependency of bn.js files is :

└─┬ nuxt@2.14.5
  └─┬ @nuxt/webpack@2.14.5
    └─┬ webpack@4.44.1
      └─┬ node-libs-browser@2.2.1
        └─┬ crypto-browserify@3.12.0
          ├─┬ browserify-sign@4.2.1
          │ ├── bn.js@5.1.3 
          │ ├─┬ browserify-rsa@4.0.1
          │ │ └── bn.js@4.11.9 
          │ ├─┬ elliptic@6.5.3
          │ │ └── bn.js@4.11.9 
          │ └─┬ parse-asn1@5.1.6
          │   └─┬ asn1.js@5.4.1
          │     └── bn.js@4.11.9 
          ├─┬ create-ecdh@4.0.4
          │ └── bn.js@4.11.9 
          ├─┬ diffie-hellman@5.0.3
          │ ├── bn.js@4.11.9 
          │ └─┬ miller-rabin@4.0.1
          │   └── bn.js@4.11.9 
          └─┬ public-encrypt@4.0.3
            └── bn.js@4.11.9 

And disappears from my package as soon as I remove the nuxt-vuex-localstorage module.

Can anyone help? @simplenotezy did you find a solution?

Thanks for the support and the library ;)

simplenotezy commented 4 years ago

Hi there,

Yes. I forked the library and removed all encryption methods. You may use my fork if you'd like. Saved roughly 2-3 megabytes in final build size.

rubystarashe commented 3 years ago

Sorry. I just removed my GIF file for readme.md and updated axios module version to latest one.

now the package size is 27.3KB.

simplenotezy commented 3 years ago

@rubystarashe I was pretty sure the huge size was due to some Crypto dependencies. Did you remove these aswell?