Skip to content

Commit f995b0d

Browse files
committed
fix: deactivate RHL in dev mode if eval not allowed
1 parent 75b5fd3 commit f995b0d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ if (!module.hot || process.env.NODE_ENV === 'production') {
1313
// RHL needs setPrototypeOf to operate Component inheritance, and eval to patch methods
1414
var jsFeaturesPresent = typeof window !== 'undefined' && !!Object.setPrototypeOf;
1515

16-
if (!jsFeaturesPresent && evalAllowed) {
16+
if (!jsFeaturesPresent || !evalAllowed) {
1717
// we are not in prod mode, but RHL could not be activated
18-
console.warn('React-Hot-Loader is not supported in this environment');
18+
console.warn('React-Hot-Loader is not supported in this environment.');
1919
module.exports = require('./dist/react-hot-loader.production.min.js');
2020
} else {
2121
module.exports = window.reactHotLoaderGlobal = require('./dist/react-hot-loader.development.js');
2222
}
23-
}
23+
}

0 commit comments

Comments
 (0)