Question: why is the unzipped version over 1.7 MB in size?
See original GitHub issueJust wondering after I added vue-grid-layout to my dependencies, I received a warning from webpack report:
Asset Size Chunks Chunk Names
static/js/vendor.e0edbedd8d1dfc9f9886.js 1.9 MB 0 [emitted] [big] vendor
was before:
Asset Size Chunks Chunk Names
static/js/vendor.2b8e22f0b833885a5a5f.js 83.5 kB 0 [emitted] vendor
Surely I can switch to the minified version which seems currently at 183KB, but I am still curious what (probably other dependency) makes vue-grid-layout so big? 😃
Thanks for all your efforts in releasing this lib open-source.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Unzipped size must be smaller than 262144000 bytes - AWS ...
The unzipped deployed package including layers cannot exceed 250MB. ... Load your package into a bucket/key on S3; In the Lambda console ...
Read more >How can I get the uncompressed size of gzip file without ...
It reports its own compressed size as ~1.7G. If it is really ~4GB I would guess there is a problem. – terdon. Jul...
Read more >Even though I zipped a folder, folder size remains the same. Is ...
It might be that the resulting zip file is a different file, and the original remained. There are several types of zipping. In...
Read more >I received my image data in zip files that end with numbers ...
How do I unzip them? In general, the HIRO will not create a single zip file larger than 1.5 GB in size because...
Read more >7-Zip - Wikipedia
Size, 1.1–1.7 MB. Available in, 89 languages. List of languages. Afrikaans, Albanian, Arabic, Aragonese, Armenian, Asturian, Azerbaijani, Bangla, Bashkir, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
With current webpack configuration library is so big because all dependencies are statically included (i don’t take into account dev-dependencies like babel core etc.). So when you build your own project, output bundle will technically contain two Vue copies, one required for project and one required for vue-grid-layout. And these two copies are not the same. Check this article: https://medium.com/webpack/webpack-bits-getting-the-most-out-of-the-commonschunkplugin-ab389e5f318
To resolve this, use common chunks plugin like in article above.
Another solution is to exclude dependencies like Vue by using “externals” directive in webpack config: https://webpack.js.org/configuration/externals/
For example if some library has dependencies like vue, vuex, vue-resource, we can exclude them from distribution file by defining in webpack configuration (configuration for this library, not your application!): externals: { ‘vue’: ‘vue’, ‘vuex’: ‘vuex’, ‘vue-resource’: ‘vue-resource’, },
Libraries listed above are now treaten like they are present in current javascript environment (for example browser), so in application that uses library, must provide these libraries explicitly like:
import Vue from ‘vue’; import Vuex from ‘vuex’; import VueResource from ‘vue-resource’; imoprt SomeLibrary from ‘some-library’;
So if vue-grid-layout would be in webpack config defined externals with Vue and Interact, usage of grid for end user would be: import Vue from ‘vue’; import interact from ‘interact.js’; import VueGridLayout from ‘vue-grid-layout’;
I’ll try and make a new build this week