{"_id":"webpack-stable-module-id-and-hash","_rev":"288386","name":"webpack-stable-module-id-and-hash","description":"To provide stable module id and reliable content chunkhash","dist-tags":{"latest":"1.0.5"},"maintainers":[{"name":"zhenyong","email":"116982086@qq.com"}],"time":{"modified":"2021-06-03T18:44:26.000Z","created":"2016-10-28T04:58:41.721Z","1.0.5":"2016-11-29T03:06:25.846Z","1.0.4":"2016-11-21T02:57:13.119Z","1.0.3":"2016-11-18T02:56:45.151Z","1.0.2":"2016-11-10T12:37:48.250Z","1.0.1":"2016-10-28T07:26:43.203Z","1.0.0":"2016-10-28T04:58:41.721Z"},"users":{"fengmiaosen":true},"author":{"name":"zhenyong","email":"116982086@qq.com"},"repository":{"type":"git","url":"git+https://github.com/zhenyong/webpack-stable-module-id-and-hash.git"},"versions":{"1.0.5":{"name":"webpack-stable-module-id-and-hash","version":"1.0.5","description":"To provide stable module id and reliable content chunkhash","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/zhenyong/webpack-stable-module-id-and-hash.git"},"author":{"name":"zhenyong","email":"116982086@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/zhenyong/webpack-stable-module-id-and-hash/issues"},"homepage":"https://github.com/zhenyong/webpack-stable-module-id-and-hash#readme","gitHead":"bb13af7dbf9556d731bb5728d55fde7191b515d9","_id":"webpack-stable-module-id-and-hash@1.0.5","_shasum":"4dc02a2bfe35abeb666e9bd355134ae9c91c01f9","_from":".","_npmVersion":"3.9.5","_nodeVersion":"4.4.7","_npmUser":{"name":"zhenyong","email":"116982086@qq.com"},"dist":{"shasum":"4dc02a2bfe35abeb666e9bd355134ae9c91c01f9","size":5799,"noattachment":false,"key":"/webpack-stable-module-id-and-hash/-/webpack-stable-module-id-and-hash-1.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/webpack-stable-module-id-and-hash/download/webpack-stable-module-id-and-hash-1.0.5.tgz"},"maintainers":[{"name":"zhenyong","email":"116982086@qq.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/webpack-stable-module-id-and-hash-1.0.5.tgz_1480388783946_0.5156665407121181"},"directories":{},"publish_time":1480388785846,"_cnpm_publish_time":1480388785846,"_hasShrinkwrap":false},"1.0.4":{"name":"webpack-stable-module-id-and-hash","version":"1.0.4","description":"To provide stable module id and reliable content chunkhash","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/zhenyong/webpack-stable-module-id-and-hash.git"},"author":{"name":"zhenyong","email":"116982086@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/zhenyong/webpack-stable-module-id-and-hash/issues"},"homepage":"https://github.com/zhenyong/webpack-stable-module-id-and-hash#readme","gitHead":"d77cd1ad55f6ef1bafc6c6a0e5ac5ef041674a05","_id":"webpack-stable-module-id-and-hash@1.0.4","_shasum":"cc47528a3ebf0acc92ee57cedde145cc4f51ade6","_from":".","_npmVersion":"3.9.5","_nodeVersion":"4.4.7","_npmUser":{"name":"zhenyong","email":"116982086@qq.com"},"dist":{"shasum":"cc47528a3ebf0acc92ee57cedde145cc4f51ade6","size":5440,"noattachment":false,"key":"/webpack-stable-module-id-and-hash/-/webpack-stable-module-id-and-hash-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/webpack-stable-module-id-and-hash/download/webpack-stable-module-id-and-hash-1.0.4.tgz"},"maintainers":[{"name":"zhenyong","email":"116982086@qq.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/webpack-stable-module-id-and-hash-1.0.4.tgz_1479697032896_0.8123711482621729"},"directories":{},"publish_time":1479697033119,"_cnpm_publish_time":1479697033119,"_hasShrinkwrap":false},"1.0.3":{"name":"webpack-stable-module-id-and-hash","version":"1.0.3","description":"To provide stable module id and reliable content chunkhash","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/zhenyong/webpack-stable-module-id-and-hash.git"},"author":{"name":"zhenyong","email":"116982086@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/zhenyong/webpack-stable-module-id-and-hash/issues"},"homepage":"https://github.com/zhenyong/webpack-stable-module-id-and-hash#readme","gitHead":"9da4e5325aa58b35ca88bdb5cc5ced5f34d438fe","_id":"webpack-stable-module-id-and-hash@1.0.3","_shasum":"c207e0e574da8012fa3dc77272bc72c895f5ad30","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"zhenyong","email":"116982086@qq.com"},"dist":{"shasum":"c207e0e574da8012fa3dc77272bc72c895f5ad30","size":5427,"noattachment":false,"key":"/webpack-stable-module-id-and-hash/-/webpack-stable-module-id-and-hash-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/webpack-stable-module-id-and-hash/download/webpack-stable-module-id-and-hash-1.0.3.tgz"},"maintainers":[{"name":"zhenyong","email":"116982086@qq.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/webpack-stable-module-id-and-hash-1.0.3.tgz_1479437803238_0.828070922056213"},"publish_time":1479437805151,"_cnpm_publish_time":1479437805151,"_hasShrinkwrap":false},"1.0.2":{"name":"webpack-stable-module-id-and-hash","version":"1.0.2","description":"To provide stable module id and reliable content chunkhash","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/zhenyong/webpack-stable-module-id-and-hash.git"},"author":{"name":"zhenyong","email":"116982086@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/zhenyong/webpack-stable-module-id-and-hash/issues"},"homepage":"https://github.com/zhenyong/webpack-stable-module-id-and-hash#readme","gitHead":"49900894831477c3bc209038a10923d44aebe284","_id":"webpack-stable-module-id-and-hash@1.0.2","_shasum":"a9a2931ff443d56cd93a6c274dd744ec046799ba","_from":".","_npmVersion":"3.9.5","_nodeVersion":"4.4.7","_npmUser":{"name":"zhenyong","email":"116982086@qq.com"},"dist":{"shasum":"a9a2931ff443d56cd93a6c274dd744ec046799ba","size":4497,"noattachment":false,"key":"/webpack-stable-module-id-and-hash/-/webpack-stable-module-id-and-hash-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/webpack-stable-module-id-and-hash/download/webpack-stable-module-id-and-hash-1.0.2.tgz"},"maintainers":[{"name":"zhenyong","email":"116982086@qq.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/webpack-stable-module-id-and-hash-1.0.2.tgz_1478781467718_0.47815495054237545"},"directories":{},"publish_time":1478781468250,"_cnpm_publish_time":1478781468250,"_hasShrinkwrap":false},"1.0.1":{"name":"webpack-stable-module-id-and-hash","version":"1.0.1","description":"To provide stable module id and reliable content chunkhash","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/zhenyong/webpack-stable-module-id-and-hash.git"},"author":{"name":"zhenyong","email":"116982086@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/zhenyong/webpack-stable-module-id-and-hash/issues"},"homepage":"https://github.com/zhenyong/webpack-stable-module-id-and-hash#readme","gitHead":"c8d0864c7cfd0e69c74c6e8dd5b3157b19d80096","_id":"webpack-stable-module-id-and-hash@1.0.1","_shasum":"a254d62a3a54866df2334c957d4a4e2090145240","_from":".","_npmVersion":"3.9.5","_nodeVersion":"4.4.7","_npmUser":{"name":"zhenyong","email":"116982086@qq.com"},"dist":{"shasum":"a254d62a3a54866df2334c957d4a4e2090145240","size":4506,"noattachment":false,"key":"/webpack-stable-module-id-and-hash/-/webpack-stable-module-id-and-hash-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/webpack-stable-module-id-and-hash/download/webpack-stable-module-id-and-hash-1.0.1.tgz"},"maintainers":[{"name":"zhenyong","email":"116982086@qq.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/webpack-stable-module-id-and-hash-1.0.1.tgz_1477639601186_0.3162336216773838"},"directories":{},"publish_time":1477639603203,"_cnpm_publish_time":1477639603203,"_hasShrinkwrap":false},"1.0.0":{"name":"webpack-stable-module-id-and-hash","version":"1.0.0","description":"To provide stable module id and reliable content chunkhash","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/zhenyong/webpack-stable-module-id-and-hash.git"},"author":{"name":"zhenyong","email":"116982086@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/zhenyong/webpack-stable-module-id-and-hash/issues"},"homepage":"https://github.com/zhenyong/webpack-stable-module-id-and-hash#readme","gitHead":"e2cab55827f30446e34f043c95b0adffd895fc7a","_id":"webpack-stable-module-id-and-hash@1.0.0","_shasum":"b14c217d1bd1593442e4e047962d85ce1221faff","_from":".","_npmVersion":"3.9.5","_nodeVersion":"4.4.7","_npmUser":{"name":"zhenyong","email":"116982086@qq.com"},"dist":{"shasum":"b14c217d1bd1593442e4e047962d85ce1221faff","size":4366,"noattachment":false,"key":"/webpack-stable-module-id-and-hash/-/webpack-stable-module-id-and-hash-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/webpack-stable-module-id-and-hash/download/webpack-stable-module-id-and-hash-1.0.0.tgz"},"maintainers":[{"name":"zhenyong","email":"116982086@qq.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/webpack-stable-module-id-and-hash-1.0.0.tgz_1477630719598_0.7703461069613695"},"directories":{},"publish_time":1477630721721,"_cnpm_publish_time":1477630721721,"_hasShrinkwrap":false}},"readme":"# WebpackStableModuleIdAndHash\n\nTo provide stable module id and reliable content chunkhash in webpack 1.x, help u make long term cache easily.\n\n## Usage\n\n\n```\nnpm install webpack-stable-module-id-and-hash --save-dev\n\n```\n\nThen new a plugin in `plugins` webpack options, only use it in **`Production`** stage build，use OccurrenceOrderPlugin for `Development` is enough.\n\n```\nvar WebpackStableModuleIdAndHash = require('webpack-stable-module-id-and-hash');\n...\nplugins: [\n...\nnew WebpackStableModuleIdAndHash()\n...\n]\n```\n\n## Why\n\nHere related discuss from github issue\n\n- [Vendor chunkhash changes when app code changes · Issue #1315 · webpack/webpack](https://github.com/webpack/webpack/issues/1315)\n\n## Target\n\n- Every output `[chunkhash]` should be calcuated (md5) by its **dependencies module contents**.\n- Every `module ID` should be stable and **only if** changes because correspond module **file path (or content)** changes.\n\n## How\n\n### Chunkhash\n\nLike [webpack-md5-hash](https://github.com/erm0l0v/webpack-md5-hash)，it calcuate chunkhash by dependen module content. \n\nBut webpack-md5-hash has a shortcoming:\n\nSince module id is not stable, `webpack-md5-hash` sort modules by id may lead some unexpect output, e.p. `chunkhash` is not stable or same chunkhash for different content of output chunk(module id change).\n\n### Stable Module Id\n\nHere some option or plugins support by webpack 1.x, like [OccurrenceOrderPlugin](http://webpack.github.io/docs/list-of-plugins.html#occurrenceorderplugin), [`recordsPath`](http://webpack.github.io/docs/configuration.html#recordspath-recordsinputpath-recordsoutputpath), [DllPlugin & DllReferencePlugin\n](http://webpack.github.io/docs/list-of-plugins.html#dllplugin)，they all try to give stable module id，but can not 100% fix problem or require you to check in extra files.\n\nWebpack 2 may fix most part of them with [HashedModuleIdsPlugin](https://github.com/webpack/webpack/blob/master/lib/HashedModuleIdsPlugin.js)\n\nLike what HashedModuleIdsPlugin to do, juse one more thing that it converts the hash to num because webpack 1.x just accept num as module id.\n\nOMG!! Forgive my poor English. Just checkout the source code.\n\n### Module ID collisions may cause builds to fail\n\nThis plugin calculates a predictable hash values based on the module file \nnames. A hashin algorithm based on MD5 is used to calculate the hash value. \nAs with any hash value, collisions are rare, but possible. In the event of a \ncollision, a `webpack-stable-module-id-and-hash module id collision` error is\nthrown during the Webpack build.\n  \nIn such a situation you can try to choose a different `seed` value to get \ndifferent module IDs that may not collide.\n   \nThe probability of a collision depends on the `hashSize` option. By default \n53 bits are used, which allow 9007199254740992 possible module IDs. This means \nthat the probability of a collision is 0.0000000000000011102% multiplied by \nthe number of modules in your project.\n\n### chunk-hash length\n\nThis plugin adds the values of `hashSize` and `seed` to the chunk-hash string.\nThat's necessary because these settings influence the module ids contained \nwithin the chunks, but *not* the MD5 chunk hash itself. Therefore, the values \nmust become part of the chunk-hash used in the filename to make it unique.\n \nWebpack by default shortens the resulting hash string to 20 characters, reducing\nthe entropy of the MD5 hash.\n\nIn practice, that shouldn't be an issue. But if you want to have a better \nhash then you can adjust the `output.hashDigestLength` Webpack setting to a \nvalue higher than 20.\n\nFor example, to compensate the reduced entropy caused by \n`webpack-stable-module-id-and-hash` you might use a setting like this:\n\n```\n  //...\n  output: {\n    //...\n    hashDigestLength: 30\n  }\n```\n\n### Options\n\nThe plugin acceps an object with these optional properties:\n \n- `hashSize` = Number of bits to use for the module ID. Defaults to the \nmaximum, 53 bits. Large hash sizes greatly reduce the probability of a \ncollision but lead also to very large module ID numbers for the generated \ncode, which might *slightly* incrase Webpack chunk sizes.\n- `seed` = Any number between 0 and 31. Different \"seed\" values cause \ncompletely different module IDs. This is useful in the event of a collision. \n","_attachments":{},"homepage":"https://github.com/zhenyong/webpack-stable-module-id-and-hash#readme","bugs":{"url":"https://github.com/zhenyong/webpack-stable-module-id-and-hash/issues"},"license":"MIT"}