Skip to content

Commit 10e6646

Browse files
committed
more safe when caching an entry chunk
fixes webpack#256
1 parent e6e0b75 commit 10e6646

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎lib/MainTemplate.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,5 +171,10 @@ MainTemplate.prototype.updateHash = function(hash) {
171171

172172
MainTemplate.prototype.useChunkHash = function(chunk) {
173173
var publicPath = this.outputOptions.publicPath || "";
174-
return !Template.REGEXP_HASH.test(publicPath);
174+
var filename = this.outputOptions.filename || "";
175+
var chunkFilename = this.outputOptions.chunkFilename || "";
176+
var hashInPublicPath = Template.REGEXP_HASH.test(publicPath) || Template.REGEXP_CHUNKHASH.test(publicPath);
177+
var hashInFilename = Template.REGEXP_HASH.test(filename) || Template.REGEXP_CHUNKHASH.test(filename);
178+
var hashInChunkFilename = Template.REGEXP_HASH.test(chunkFilename) || Template.REGEXP_CHUNKHASH.test(chunkFilename);
179+
return !hashInPublicPath && !hashInFilename && !hashInChunkFilename;
175180
};

0 commit comments

Comments
 (0)