-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs on bundles, chunks, long term caching #134
Labels
Comments
Doesnt this file solve this issue? |
Yup. Time to close. |
hzuhyb
pushed a commit
to hzuhyb/webpack.js.org
that referenced
this issue
Feb 18, 2017
/content/concepts/index.md 校对
I came here trying to understand what a chunk is, but no help. The link @pksjce posted is broken, also |
If it is the link to the "caching" documentation, that didn't help me to understand what a chunk is. |
@rafaeleyng #970 is definitely the issue you want. I just re-opened. |
Ok, I asked some questions there too. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From @greaber on June 25, 2016 17:15
I'm posting this because I think I understand something about webpack, but I'm not sure, and whether I am right or not, I think the docs could be improved.
I have been using webpack for several months, and I was hazy for a long time about the difference between chunks and bundles. As I now understand it, though, it is pretty simple. a chunk is just any output produced by webpack, and a bundle is (essentially) all the outputs produced by webpack. At any rate, the
chunkhash
directive, used in naming an output, expands to a hash of that output, while thebundle
directive expands to a hash of all the outputs. If this understanding is right, I think it could be made more clear in the docs.Some things that make it confusing are that "bundle" is often used to name a particular output and that the long term caching docs suggest there are two options that you might equally want, using per-chunk hashes and using per-bundle hashes, whereas, if I understand correctly, you would almost always want to use a per-chunk hash. (The only downside of that seems to be that, according to the docs, you cannot use it in conjunction with hot module replacement, but my understanding is that hot module replacement is a dev feature, and you don't need to use any of this hashing in dev because you can just use the dev server or simply disable caching.)
Another thing that is perhaps confusing about these concepts of chunks and bundles is the way the
output
section has options forfilename
andchunkFilename
. If my understanding is correct, all outputs are chunks, and all chunks outputs. Thefilename
option is just used to specify the names of entry chunks. But the docs for it say "Specifies the name of each output file on disk", so I'm not sure.Copied from original issue: webpack/webpack#2692
The text was updated successfully, but these errors were encountered: