Skip to content

Commit

Permalink
fixup! feat: [ts-starter #9] create a minimal bootstrap entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsanmmd committed Mar 23, 2024
1 parent a10107b commit 0331bd2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ const App = lazy(async () => import("./App"));

export default function Index(): ReactElement {
return (
<ErrorBoundary fallback={<div>shit hit the fan bruv!</div>}>
<ErrorBoundary FallbackComponent={Fallback}>
<Suspense fallback="loading">
<App />
</Suspense>
</ErrorBoundary>
);
}

function Fallback({ error }: { error: Error }): ReactElement {
return <p>{error.message}</p>;
}
11 changes: 7 additions & 4 deletions webpack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,13 @@ function webpackConfig(_env, { mode = "development" }) {
}),
isDevelopment && new ReactRefreshWebpackPlugin(),
].filter(Boolean),
performance: {
maxEntrypointSize: 150000,
hints: "warning",
},
performance:
mode === "production"
? {
maxEntrypointSize: 200000,
hints: "warning",
}
: undefined,
};
}

Expand Down

0 comments on commit 0331bd2

Please sign in to comment.