mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
build: enable next server (#2992)
This commit is contained in:
@@ -45,17 +45,12 @@ if (process.env.COVERAGE === 'true') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const profileTarget = {
|
const profileTarget = {
|
||||||
ac: '100.85.73.88:12001',
|
|
||||||
dev: '100.84.105.99:11001',
|
|
||||||
test: '100.84.105.99:11001',
|
|
||||||
stage: '',
|
|
||||||
prod: 'https://app.affine.pro',
|
|
||||||
local: '127.0.0.1:3000',
|
local: '127.0.0.1:3000',
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
output: 'export',
|
output: process.env.NODE_ENV === 'development' ? 'standalone' : 'export',
|
||||||
typescript: {
|
typescript: {
|
||||||
// We use `yarn typecheck` on top level to check types
|
// We use `yarn typecheck` on top level to check types
|
||||||
ignoreBuildErrors: true,
|
ignoreBuildErrors: true,
|
||||||
@@ -109,9 +104,7 @@ const nextConfig = {
|
|||||||
BUILD_DATE: new Date().toISOString(),
|
BUILD_DATE: new Date().toISOString(),
|
||||||
gitVersion: getGitVersion(),
|
gitVersion: getGitVersion(),
|
||||||
hash: getCommitHash(),
|
hash: getCommitHash(),
|
||||||
serverAPI:
|
serverAPI: profileTarget.local,
|
||||||
profileTarget[process.env.API_SERVER_PROFILE || 'dev'] ??
|
|
||||||
profileTarget.dev,
|
|
||||||
editorFlags: blockSuiteFeatureFlags,
|
editorFlags: blockSuiteFeatureFlags,
|
||||||
...buildFlags,
|
...buildFlags,
|
||||||
},
|
},
|
||||||
@@ -157,6 +150,15 @@ const nextConfig = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === 'development') {
|
||||||
|
nextConfig.rewrites = async () => [
|
||||||
|
{
|
||||||
|
source: '/api/auth/:path*/:path2*',
|
||||||
|
destination: 'http://localhost:3010/api/auth/:path*/:path2*',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
const baseDir = process.env.LOCAL_BLOCK_SUITE ?? '/';
|
const baseDir = process.env.LOCAL_BLOCK_SUITE ?? '/';
|
||||||
const withDebugLocal = debugLocal(
|
const withDebugLocal = debugLocal(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user