Skip to content

Conversation

@jrr
Copy link
Contributor

@jrr jrr commented Aug 30, 2020

Out of the box today, CRA produces numbered vendor chunks. They look like this in production:

File sizes after gzip:

  146.17 KB       build/static/js/7.f5a20c19.chunk.js
  39.39 KB        build/static/js/8.5cf7927d.chunk.js

And like this in development:

image

This is a good default for production, following webpack's guidance (splitChunks.name: false) to create stable, cacheable names.

In development, though, when I'm trying to understand exactly what code is delivered when, I'd like to know more about what goes in to those chunks.

This PR sets splitChunks.name to true in development, producing vendor chunk names like this:

image

Is this something others would be interested in?

Related issues:
#4769
#6155
#6240

@jrr
Copy link
Contributor Author

jrr commented Sep 11, 2020

@iansu @mrmckeb @ianschmitz @petetnt I know you probably have a ton of stuff to review right now, but this is a 1-line change that shouldn't take a lot of thought. Can you take a look?

@mrmckeb
Copy link
Contributor

mrmckeb commented Sep 12, 2020

I'm not opposed to this, any thoughts @ianschmitz or @iansu?

@stale
Copy link

stale bot commented Oct 12, 2020

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Oct 12, 2020
@jrr
Copy link
Contributor Author

jrr commented Oct 12, 2020

Bump! I still want this one-line change.

@stale stale bot removed the stale label Oct 12, 2020
@jrr jrr force-pushed the development-chunk-names branch from f03bbf9 to 8432ce1 Compare October 12, 2020 14:48
@jrr jrr force-pushed the development-chunk-names branch from 8432ce1 to 81ea7ad Compare November 30, 2020 15:49
@jrr jrr closed this Dec 7, 2020
@jrr jrr reopened this Dec 7, 2020
@ianschmitz ianschmitz added this to the 4.0.2 milestone Dec 8, 2020
@ianschmitz ianschmitz changed the title Better vendor chunk names in development Improve vendor chunk names in development Dec 8, 2020
@ianschmitz ianschmitz merged commit 8f2413e into facebook:master Dec 8, 2020
@ianschmitz
Copy link
Contributor

Good idea @jrr. Seems like a good quality of life improvement. Thanks!