We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e28c750 commit b12b430Copy full SHA for b12b430
index.js
@@ -1,6 +1,8 @@
1
'use strict'
2
3
-if (!module.hot || process.env.NODE_ENV === 'production') {
+var hasWindow = typeof window !== 'undefined';
4
+
5
+if (!module.hot || process.env.NODE_ENV === 'production' || !hasWindow) {
6
module.exports = require('./dist/react-hot-loader.production.min.js');
7
} else {
8
var evalAllowed = false;
@@ -11,7 +13,7 @@ if (!module.hot || process.env.NODE_ENV === 'production') {
11
13
}
12
14
15
// RHL needs setPrototypeOf to operate Component inheritance, and eval to patch methods
- var jsFeaturesPresent = typeof window !== 'undefined' && !!Object.setPrototypeOf;
16
+ var jsFeaturesPresent = !!Object.setPrototypeOf;
17
18
if (!jsFeaturesPresent || !evalAllowed) {
19
// we are not in prod mode, but RHL could not be activated
0 commit comments