diff --git a/mon-entreprise/source/site/entry.en.tsx b/mon-entreprise/source/site/entry.en.tsx index 6ea80221e..e357a387d 100644 --- a/mon-entreprise/source/site/entry.en.tsx +++ b/mon-entreprise/source/site/entry.en.tsx @@ -1,3 +1,7 @@ +// We disable Speedy mode for Styled-Component in production because it created a bug for overlay appearance +// https://stackoverflow.com/questions/53486470/react-styled-components-stripped-out-from-production-build +global.SC_DISABLE_SPEEDY = true + import 'core-js/stable' import { hot } from 'react-hot-loader/root' import { render } from 'react-dom' diff --git a/mon-entreprise/source/site/entry.fr.tsx b/mon-entreprise/source/site/entry.fr.tsx index dc8daf1d0..496b24d28 100644 --- a/mon-entreprise/source/site/entry.fr.tsx +++ b/mon-entreprise/source/site/entry.fr.tsx @@ -1,3 +1,7 @@ +// We disable Speedy mode for Styled-Component in production because it created a bug for overlay appearance +// https://stackoverflow.com/questions/53486470/react-styled-components-stripped-out-from-production-build +global.SC_DISABLE_SPEEDY = true + import { hot } from 'react-hot-loader/root' import 'core-js/stable' import 'react-hot-loader' diff --git a/mon-entreprise/source/types/app-env.d.ts b/mon-entreprise/source/types/app-env.d.ts index 59e04ecf6..bd0d28790 100644 --- a/mon-entreprise/source/types/app-env.d.ts +++ b/mon-entreprise/source/types/app-env.d.ts @@ -15,4 +15,8 @@ declare namespace NodeJS { DEEPL_API_SECRET: string INSEE_SIRENE_API_SECRET: string } + + interface Global { + SC_DISABLE_SPEEDY: boolean + } }