Skip to content
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

chunkhash of produced assets changes even if source stays the same #7

Closed
sheerun opened this issue Nov 27, 2015 · 11 comments
Closed

chunkhash of produced assets changes even if source stays the same #7

sheerun opened this issue Nov 27, 2015 · 11 comments

Comments

@sheerun
Copy link
Contributor

sheerun commented Nov 27, 2015

Hey,

I tried to use your plugin, but the chunkhash of my vendor chunk changes even if I don't modify any of my vendor dependencies.. Here is my configuration:

    new SplitByPathPlugin([
      {
        name: 'vendor',
        path: path.join(__dirname, 'node_modules')
      }
    ])

Any tips?

@sheerun
Copy link
Contributor Author

sheerun commented Nov 27, 2015

I only changed application code.

@sheerun
Copy link
Contributor Author

sheerun commented Nov 27, 2015

The vendor file differs only in following:

79c79
< /******/                      script.src = __webpack_require__.p + "" + ({"0":"index"}[chunkId]||chunkId) + "-" + {"0":"e87843f64ed5fbf75cab"}[chunkId] + ".js";
---
> /******/                      script.src = __webpack_require__.p + "" + ({"0":"index"}[chunkId]||chunkId) + "-" + {"0":"556dee5231cea6b6d18a"}[chunkId] + ".js";
25564c25564
< //# sourceMappingURL=vendor-e2ddf7a8873cca94ab3b.js.map
\ No newline at end of file
---
> //# sourceMappingURL=vendor-ef861294c72026118f27.js.map
\ No newline at end of file

@BohdanTkachenko
Copy link
Owner

Can you please provide sample project where this can be reproduced? I'll try to debug it

@sheerun
Copy link
Contributor Author

sheerun commented Nov 28, 2015

It' the default one you provided in the readme:
https://github.com/sheerun/webpack-split

Please change v2 to v3 in index.js, and notice that vendor contents and chunkhash changes upon rebuild

@sheerun
Copy link
Contributor Author

sheerun commented Nov 28, 2015

The comment in vendor bundle says:

/******/    // This file contains only the entry chunk.
/******/    // The chunk loading function for additional chunks

Shouldn't it be the other way around? The index chunk should be entry chunk and load vendor one..

@e-cloud
Copy link
Contributor

e-cloud commented May 18, 2016

+1, the hash of seldom changed vendor.js should not change every compilation

@s-panferov
Copy link

Related thread: webpack/webpack#1315

The main idea there is to extract manifest chunk that changes every time.

@spiffytech
Copy link

👍

@BohdanTkachenko
Copy link
Owner

Sorry, I don't have much free time now, so I can't quickly fix this issue, but I will be able to accept PR if someone will make one.

@e-cloud
Copy link
Contributor

e-cloud commented Jun 29, 2016

so should we separate the manifest module to a standalone chunk as built-in behavior of this plugin or just an option?

e-cloud added a commit to e-cloud/webpack-split-by-path that referenced this issue Jun 30, 2016
1. move the bucketChunks management out of the entry chunk loop which makes more sense.
2. create a manifest chunk to act as the only entry chunk.

see discussion in BohdanTkachenko#7

ps: improve example's html script entries
@BohdanTkachenko
Copy link
Owner

@e-cloud did a pull request that seems to be fixing this issue. Closing this issue for now. Please re-open it if there still any problems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants