Skip to content

Commit

Permalink
unbreak NPM publishing (mdn#2949)
Browse files Browse the repository at this point in the history
Fixes mdn#2939
  • Loading branch information
peterbe authored Feb 16, 2021
1 parent 47f4b7f commit 5f398b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ function LoadingFallback({ message }: { message?: string }) {
export function App(appProps) {
useDebugGA();

const homePage = CRUD_MODE ? <WritersHomepage /> : <Homepage {...appProps} />;
// When preparing a build for use in the NPM package, CRUD_MODE is always true.
// But if the App is loaded from the code that builds the SPAs, then `isServer`
// is true. So you have to have `isServer && CRUD_MODE` at the same time.
const homePage =
!isServer && CRUD_MODE ? <WritersHomepage /> : <Homepage {...appProps} />;

const routes = (
<Routes>
Expand Down

0 comments on commit 5f398b3

Please sign in to comment.