Fixed Hash Cycle

This commit is contained in:
Tobias Koppers 2013-07-08 08:12:48 +02:00
parent 80b667f57f
commit 6c1e98f759
3 changed files with 6 additions and 6 deletions

View File

@ -52,11 +52,11 @@ HotModuleReplacementPlugin.prototype.apply = function(compiler) {
compilation.plugin("after-hash", function() {
var records = this.records;
if(!records) return;
if(!records.hash) return;
var preHash = records.preHash;
if(!preHash) preHash = "x";
var lastHash = records.hash || "x";
var preHash = records.preHash || "x";
var prepreHash = records.prepreHash || "x";
if(preHash === this.hash) {
this.modifyHash(records.prepreHash);
this.modifyHash(prepreHash);
return;
}
records.prepreHash = records.hash || "x";

View File

@ -1,6 +1,6 @@
{
"name": "webpack",
"version": "0.11.0-beta11",
"version": "0.11.0-beta12",
"author": "Tobias Koppers @sokra",
"description": "Packs CommonJs/AMD/Labeled Modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jade, coffee, css, less, ... and your custom stuff.",
"dependencies": {

View File

@ -9,7 +9,7 @@ describe("HotModuleReplacementPlugin", function() {
var entryFile = path.join(__dirname, "js", "entry.js");
var recordsFile = path.join(__dirname, "js", "records.json");
try { fs.mkdirSync(path.join(__dirname, "js")); } catch(e) {}
try { fs.unlinkFileSync(recordsFile); } catch(e) {}
try { fs.unlinkSync(recordsFile); } catch(e) {}
var compiler = webpack({
entry: entryFile,
recordsPath: recordsFile,