diff --git a/extensions/ohif-i18n/src/index.js b/extensions/ohif-i18n/src/index.js index f11da3c37..eb4f693e9 100755 --- a/extensions/ohif-i18n/src/index.js +++ b/extensions/ohif-i18n/src/index.js @@ -31,7 +31,8 @@ function getKeyForNameSpaces(key) { } function getLocales() { - const isWebpackEnv = typeof require.context === 'function'; + const isWebpackEnv = !!require.context('./locales', true, /\.json$/); + // require.context is exclusive from webpack, it's needed to escape inside jest if (!isWebpackEnv) { return {};