Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/webapp/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const nextConfig: NextConfig = {
compiler: {
reactRemoveProperties: { properties: ['^data-testid$'] },
},
webpack: (config) => {
webpack: (config, { dev }) => {
// Grab the existing rule that handles SVG imports
const fileLoaderRule = config.module.rules.find((rule) =>
rule.test?.test?.('.svg'),
Expand Down Expand Up @@ -99,6 +99,12 @@ const nextConfig: NextConfig = {
// eslint-disable-next-line no-param-reassign
config.resolve.alias['cross-fetch'] = false;

// Exclude agentation from production builds
if (!dev) {
// eslint-disable-next-line no-param-reassign
config.resolve.alias.agentation = false;
}

return config;
},
env: {
Expand Down
1 change: 1 addition & 0 deletions packages/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@serwist/next": "^9.0.9",
"@tanstack/react-query": "^5.80.5",
"@tanstack/react-query-devtools": "^5.80.5",
"agentation": "^1.3.0",
"classnames": "^2.5.1",
"date-fns": "^2.28.0",
"date-fns-tz": "1.2.2",
Expand Down
8 changes: 8 additions & 0 deletions packages/webapp/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ const CookieBanner = dynamic(
),
);

const Agentation =
process.env.NODE_ENV === 'development'
? dynamic(() => import('agentation').then((mod) => mod.Agentation), {
ssr: false,
})
: null;

interface ComponentGetLayout {
getLayout?: (
page: ReactNode,
Expand Down Expand Up @@ -306,6 +313,7 @@ export default function App(
</BootDataProvider>
<ReactQueryDevtools />
</HydrationBoundary>
{Agentation && <Agentation />}
</QueryClientProvider>
</ProgressiveEnhancementContextProvider>
);
Expand Down
14 changes: 14 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.