question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DLL mode bundle sizes

See original GitHub issue

Version

3.0.0-beta.6

Reproduction link

https://codesandbox.io/s/ppo0y403lj

Steps to reproduce

Enable DLL mode by setting the dll option in vue.config.js to true (as per docs):

// vue.config.js
module.exports = {
  dll: true
}

What is expected?

Vendor libs not to be included in app bundle; bundle sizes to be reduced.

What is actually happening?

With the option set to true, some node_modules are packaged into the app bundle – the opposite of a build with the option disabled, and hence the opposite of the option’s function described by the documentation.

Comparison of build sizes given the following base project set-up:

vue create -i '{"plugins": { "@vue/cli-plugin-babel": {} }, "router": true, "vuex": true}' my-project

dll: false (the default):

  File                          Size                   Gzipped

  dist/js/vendor.456df753.js    95.01 kb               32.36 kb
  dist/js/app.be870e84.js       12.51 kb               8.05 kb
  dist/css/app.8b290d57.css     0.42 kb                0.26 kb

  Images and other types of assets omitted.

dll: true:

  File                          Size                   Gzipped

  dist/js/vendor.3884c493.js    95.12 kb               32.29 kb
  dist/js/app.d8cf8ae4.js       13.89 kb               8.71 kb
  dist/css/app.8b290d57.css     0.42 kb                0.26 kb

  Images and other types of assets omitted.

The difference is exacerbated as projects grow.


Is this condition the opposite of what it should be?

Unless I’m mistaken in how this feature should work, the consequence of changing/fixing this will be that all vue-cli generated apps’ bundle sizes will subsequently increase, except those where the option has already been set to true in the anticipation it would reduce bundle sizes (which it isn’t currently), in which case future builds will be smaller 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
yyx990803commented, Mar 17, 2018

So, DLL mode is in fact meant for production builds. It is only for projects that are so big that builds can take minutes.

The reason for DLL builds having a bigger size is probably because DLL vendor bundle includes all dependencies listed in package.json without tree-shaking. So, this is a tradeoff that the user has to make on their own - sacrificing bundle size for a faster build, or the other way around. This may also has something to do with auto-dll-webpack-plugin, which is used in producing the DLL bundle.

I think we should probably mark DLL mode as experimental for now.

1reaction
Akryumcommented, Mar 17, 2018

I have a bunch of code I use at work: https://gist.github.com/Akryum/53da1c59775cdb4beace2f6189b40205 Maybe it can be useful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

selecting webpack dll bundle via scope mode - Stack Overflow
Is there any way to specify the library that the bundle should use? I thought the scope option in DllReferencePlugin would do the...
Read more >
DllPlugin - webpack
The DllPlugin and DllReferencePlugin provide means to split bundles in a way that can ... This plugin can be used in two different...
Read more >
Bundling and Minification | Microsoft Learn
Bundling is a new feature in ASP.NET 4.5 that makes it easy to combine or bundle multiple files into a single file. You...
Read more >
PEBundle
PEBundle was the *first* in-memory bundler of DLLs for Windows. ... This mode, called the "Advanced Bundle" in the GUI, allows dynamic link...
Read more >
Reducing the file size of your build - Unity - Manual
Xml.dll. Unity does not include these in the built player by default, but if you use their classes, they are included. These DLLs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found