From 9529689b497ab1e139bbf7f581f494e89644634d Mon Sep 17 00:00:00 2001 From: uonr Date: Thu, 12 Dec 2024 17:26:57 +0900 Subject: [PATCH] fix(site): nix build --- apps/site/next.config.js | 5 +++++ flake.nix | 1 + 2 files changed, 6 insertions(+) diff --git a/apps/site/next.config.js b/apps/site/next.config.js index 82afbf86..e9c546e0 100644 --- a/apps/site/next.config.js +++ b/apps/site/next.config.js @@ -1,6 +1,7 @@ const path = require('path'); const withBundleAnalyzer = require('@next/bundle-analyzer')(); const BACKEND_URL = process.env.BACKEND_URL; +const STANDALONE = process.env.STANDALONE === 'true'; if (!BACKEND_URL) { throw new Error('BACKEND_URL is required'); } @@ -20,6 +21,7 @@ const config = { eslint: { dirs: ['src', 'tests'], }, + output: STANDALONE ? 'standalone' : undefined, env: { PUBLIC_MEDIA_URL: process.env.PUBLIC_MEDIA_URL, BACKEND_URL: process.env.BACKEND_URL, @@ -27,6 +29,9 @@ const config = { DOMAIN: process.env.DOMAIN, }, transpilePackages: ['@boluo/ui', '@boluo/common'], + experimental: { + outputFileTracingRoot: STANDALONE ? path.join(__dirname, '../../') : undefined, + }, rewrites, webpack: (config) => { // `react-intl` without parser diff --git a/flake.nix b/flake.nix index 06ef1367..785aa9fc 100644 --- a/flake.nix +++ b/flake.nix @@ -169,6 +169,7 @@ PUBLIC_MEDIA_URL = "https://media.boluo.chat"; BACKEND_URL = "https://boluo.chat"; + STANDALONE = "true"; configurePhase = '' runHook preConfigure