🔨 chore: integrate code inspector plugin and update turbopack configuration (#10588)

* feat: integrate code inspector plugin and update turbopack configuration

Signed-off-by: Innei <tukon479@gmail.com>

* chore: add e2e env

---------

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-12-05 14:35:11 +08:00
committed by GitHub
parent 068d5d34f8
commit bde9bde17c
3 changed files with 15 additions and 1 deletions

View File

@@ -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);

View File

@@ -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,

View File

@@ -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",