mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-26 13:19:34 +07:00
🔨 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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user