https://github.com/thundernet8/webpackhashtest
https://github.com/thundernet8/webpackhashtest
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/thundernet8/webpackhashtest
- Owner: thundernet8
- License: gpl-3.0
- Created: 2017-07-08T11:52:04.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-11T05:31:56.000Z (almost 9 years ago)
- Last Synced: 2025-03-01T04:24:55.221Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://github.com/thundernet8/Blog/issues/2
- Size: 60.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## WebpackHashTest
[Post About this](https://github.com/thundernet8/Blog/issues/2)
## More
The official hashmoduleidsplugin could keep chunhash stable via using hash module id rather than number id, but it does not change the entry chunks specified in config.entry to have a hash id, and sometimes the entry chunk order may change without a config.entry change which lead to a chunkhash change.
So I write a webpack plugin [WebpackStableChunkId](https://www.npmjs.com/package/webpackstablechunkid)to solve this, clilk[this](./webpack.config.babel.js) to find the usage.
webpack自带的hashmoduleidsplugin插件通过将模块的id以引用路径的hash特征值表示,以稳定chunkhash,但是config.entry中指定的chunks仍然使用了数字id,而且有些时候尽管config.entry未改变,这些entry chunks的排序会变化,导致chunk id变化,则chunkhash在代码内容未更改的情况意外更新了。
因此我写了一个webpack插件[WebpackStableChunkId](https://www.npmjs.com/package/webpackstablechunkid)来解决这个问题,查看[示例](./webpack.config.babel.js)。