geniuscarrier / webpack-boilerplate

A webpack boilerplate in order to quickly build up a production-ready marketing website.
525 stars 63 forks source link

Redundant deps in prod build #7

Open jalooc opened 6 years ago

jalooc commented 6 years ago

Not really so production ready if there are two parallel 30k gzipped jquery deps ;)

image

geniuscarrier commented 6 years ago

@jalooc good call. Mind creating a pr to fix it?

jalooc commented 6 years ago

Okay, just found out it happens only with yarn - jquery.scrollTo has jQuery dep at jquery@>=1.8 resolving to 3.2.1 and webpack-boilerplate denotes jquery@^2.2.2 which resolves currently to 2.2.4. Apparently, yarn has different deps flattening strategy and sees 2.2.4 !== 3.2.1, whilst npm takes the highest suitable for both: 2.2.4.

So it's up to you what to do:

  1. Disregard yarn users and do nothing;
  2. Update your jQuery dependency to sth gte 3.0.0;
  3. Poke jquery.scrollto package creators to drop the highly unreliable dep version scheme with >= which accepts all versions, even the breaking ones. <- this is the most legit option