Skip to content

Commit

Permalink
Better env
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Jun 14, 2023
1 parent aa77592 commit bca1e73
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ import installSearchEngine from './search';
import GeocharsWidget from './components/theme/Widgets/GeocharsWidget';
import GeolocationWidget from './components/theme/Widgets/GeolocationWidget';

const getEnv = () => (typeof window !== 'undefined' ? window.env : process.env);

const applyConfig = (config) => {
const notInEnMission = /^(?!(\/en\/mission)).*$/;
if (
!(
__DEVELOPMENT__ ||
(process.env.RAZZLE_DISABLE_EXTERNAL_ROUTES &&
process.env.RAZZLE_DISABLE_EXTERNAL_ROUTES === 'True')
)
) {
const env = getEnv();
const isStaging = !!env.RAZZLE_IS_STAGING;
const enableMissionIsExternal = !isStaging && !__DEVELOPMENT__;

if (enableMissionIsExternal) {
config.settings.externalRoutes = [
...(config.settings.externalRoutes || []),
{
Expand Down

0 comments on commit bca1e73

Please sign in to comment.