Metnew / vue-element-starter

Vue starter with Element-UI [READY, unmaintained now]
https://metnew.github.io/vue-element-starter/
MIT License
216 stars 38 forks source link

Large client.js file #8

Open davestewart opened 7 years ago

davestewart commented 7 years ago

Hi,

Just running the npm run build script with the base install and I get a 485kb file:

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (250 kB).
This can impact web performance.
Assets: 
  client.83f492b0.js (485 kB)

image

Seems huge for a prod build, and one I've not added to.

Is this a configuration issue?

Metnew commented 7 years ago

Hi, thanks for your issue! Yes, it really was a configuration issue in build/config.js. It was fixed in 346a18d7d95a4e322be53e9543ad105b5bec9444.

davestewart commented 7 years ago

Nice one!

Still a huge vendor file though.

Do you have any advice on how to trim this down?

I know Rollup would probably use something like tree shaking to minimise bloat; I presume WebPack has something similar?

(though saying that Element UI on Foss CDN is 400k, but I guess that's the whole lib)

Metnew commented 7 years ago

Yes, Webpack has tree-shaking and other tools to minimize bundle. The whole element-ui is include in vendor.js file. So, the best way to minimize bundle is code-splitting + lazy-loading. Another way is just code-splitting, but it still doesn't fix issues with bundle size. Also, 400kb in vendor it's not too huge bundle, imho

liuguangyong93 commented 6 years ago

yes,Element-ui so much big