Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit c0bfa70

Browse files
committed
Fix double request on load
1 parent 11ac516 commit c0bfa70

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

loader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ module.exports.pitch = function(request) {
113113
if (text.locals) {
114114
resultSource += "\nmodule.exports = " + JSON.stringify(text.locals) + ";";
115115
}
116-
resultSource += "\nif(module.hot){\nmodule.hot.accept();\nrequire('" + extractTextPluginHmrRuntime + "')('%%extracted-hash%%','" + publicPath + "','%%extracted-file%%');}";
116+
// module.hot.data is undefined on initial load, and an object in hot updates
117+
resultSource += "\nif(module.hot){\nmodule.hot.accept();\nif(module.hot.data){\nrequire('" + extractTextPluginHmrRuntime + "')('%%extracted-hash%%','" + publicPath + "','%%extracted-file%%');\n}\n}";
117118
}
118119
} catch(e) {
119120
return callback(e);

0 commit comments

Comments
 (0)