From 1e127df4ab520a04498a934ae0cabfad67133771 Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 13 Nov 2025 14:53:41 +0800 Subject: [PATCH] chore --- web/app/(commonLayout)/layout.tsx | 2 ++ web/app/edition/community/test.tsx | 10 ++++++++++ web/app/edition/saas/test.tsx | 10 ++++++++++ web/next.config.js | 12 +++++++++++- web/tsconfig.json | 3 +++ 5 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 web/app/edition/community/test.tsx create mode 100644 web/app/edition/saas/test.tsx diff --git a/web/app/(commonLayout)/layout.tsx b/web/app/(commonLayout)/layout.tsx index bd5b9bead2..e30b08acb5 100644 --- a/web/app/(commonLayout)/layout.tsx +++ b/web/app/(commonLayout)/layout.tsx @@ -11,6 +11,7 @@ import { ModalContextProvider } from '@/context/modal-context' import GotoAnything from '@/app/components/goto-anything' import Zendesk from '@/app/components/base/zendesk' import Splash from '../components/splash' +import Test from '@edition/test' const Layout = ({ children }: { children: ReactNode }) => { return ( @@ -21,6 +22,7 @@ const Layout = ({ children }: { children: ReactNode }) => { +
diff --git a/web/app/edition/community/test.tsx b/web/app/edition/community/test.tsx new file mode 100644 index 0000000000..f2cc862a2b --- /dev/null +++ b/web/app/edition/community/test.tsx @@ -0,0 +1,10 @@ +'use client' +import type { FC } from 'react' +import React from 'react' + +const Test: FC = () => { + return ( +
Community
+ ) +} +export default React.memo(Test) diff --git a/web/app/edition/saas/test.tsx b/web/app/edition/saas/test.tsx new file mode 100644 index 0000000000..e05f503337 --- /dev/null +++ b/web/app/edition/saas/test.tsx @@ -0,0 +1,10 @@ +'use client' +import type { FC } from 'react' +import React from 'react' + +const Test: FC = () => { + return ( +
SaaS
+ ) +} +export default React.memo(Test) diff --git a/web/next.config.js b/web/next.config.js index c4f6fc87b6..6c4dff7f2e 100644 --- a/web/next.config.js +++ b/web/next.config.js @@ -1,4 +1,5 @@ const { codeInspectorPlugin } = require('code-inspector-plugin') +const path = require('path') const withPWA = require('next-pwa')({ dest: 'public', register: true, @@ -87,6 +88,12 @@ const hasSetWebPrefix = process.env.NEXT_PUBLIC_WEB_PREFIX const port = process.env.PORT || 3000 const locImageURLs = !hasSetWebPrefix ? [new URL(`http://localhost:${port}/**`), new URL(`http://127.0.0.1:${port}/**`)] : [] const remoteImageURLs = [hasSetWebPrefix ? new URL(`${process.env.NEXT_PUBLIC_WEB_PREFIX}/**`) : '', ...locImageURLs].filter(item => !!item) +const editionPath = + process.env.NEXT_PUBLIC_EDITION === 'CLOUD' + ? './app/edition/saas/test.tsx' + : './app/edition/community/test.tsx' +path.resolve(__dirname, editionPath, '*') +console.log(editionPath) /** @type {import('next').NextConfig} */ const nextConfig = { @@ -95,7 +102,10 @@ const nextConfig = { turbopack: { rules: codeInspectorPlugin({ bundler: 'turbopack' - }) + }), + // resolveAlias: { + // '@edition/test': editionPath, + // } }, productionBrowserSourceMaps: false, // enable browser source map generation during the production build // Configure pageExtensions to include md and mdx diff --git a/web/tsconfig.json b/web/tsconfig.json index 3b022e4708..0a30ff596e 100644 --- a/web/tsconfig.json +++ b/web/tsconfig.json @@ -29,6 +29,9 @@ ], "~@/*": [ "./*" + ], + "@edition/*": [ + "./app/edition/community/*" ] } },