diff --git a/e2e/src/steps/hooks.ts b/e2e/src/steps/hooks.ts index 2b8033b0f9..747d7f468c 100644 --- a/e2e/src/steps/hooks.ts +++ b/e2e/src/steps/hooks.ts @@ -3,6 +3,7 @@ import { After, AfterAll, Before, BeforeAll, Status, setDefaultTimeout } from '@ import { startWebServer, stopWebServer } from '../support/webServer'; import { CustomWorld } from '../support/world'; +process.env['E2E'] = '1'; // Set default timeout for all steps to 120 seconds setDefaultTimeout(120_000); diff --git a/next.config.ts b/next.config.ts index 603370a891..507b4806ed 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,5 +1,6 @@ import analyzer from '@next/bundle-analyzer'; import withSerwistInit from '@serwist/next'; +import { codeInspectorPlugin } from 'code-inspector-plugin'; import type { NextConfig } from 'next'; import ReactComponentName from 'react-scan/react-component-name/webpack'; @@ -10,6 +11,9 @@ const enableReactScan = !!process.env.REACT_SCAN_MONITOR_API_KEY; const isUsePglite = process.env.NEXT_PUBLIC_CLIENT_DB === 'pglite'; const shouldUseCSP = process.env.ENABLED_CSP === '1'; +const isTest = + process.env.NODE_ENV === 'test' || process.env.TEST === '1' || process.env.E2E === '1'; + // if you need to proxy the api endpoint to remote server const isStandaloneMode = buildWithDocker || isDesktop; @@ -268,8 +272,16 @@ const nextConfig: NextConfig = { // when external packages in dev mode with turbopack, this config will lead to bundle error serverExternalPackages: isProd ? ['@electric-sql/pglite', 'pdfkit'] : ['pdfkit'], + transpilePackages: ['pdfjs-dist', 'mermaid', 'better-auth-harmony'], - turbopack: {}, + turbopack: { + rules: isTest + ? void 0 + : codeInspectorPlugin({ + bundler: 'turbopack', + hotKeys: ['altKey'], + }), + }, typescript: { ignoreBuildErrors: true, diff --git a/package.json b/package.json index 4c478463f8..38e1c6b6e8 100644 --- a/package.json +++ b/package.json @@ -359,6 +359,7 @@ "@typescript/native-preview": "7.0.0-dev.20251102.1", "@vitest/coverage-v8": "^3.2.4", "ajv-keywords": "^5.1.0", + "code-inspector-plugin": "1.3.0", "commitlint": "^19.8.1", "consola": "^3.4.2", "cross-env": "^10.1.0",