From 816354637adcef7a9c6945147d1b12a3ecc636a5 Mon Sep 17 00:00:00 2001 From: chenos Date: Tue, 14 Jan 2025 21:33:02 +0800 Subject: [PATCH 1/2] fix: ssr --- .dumirc.ts | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.dumirc.ts b/.dumirc.ts index 0aecb6dee6..9daf7047ad 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -39,6 +39,36 @@ export default defineConfig({ exportStatic: { ignorePreRenderError: true, }, + ssr: process.env.NODE_ENV === 'production' ? { builder: 'webpack' } : false, + sitemap: process.env.NODE_ENV === 'production' ? { + hostname: site_url, + } : false, + // metas: [ + // { name: 'keywords', content: 'nocobase,nocobase doc,low-code,no-code,self-hosted,open source,open-source,no-code development,low-code development,workflow management software,business process management,collaboration software,enterprise process management,enterprise management system,no-code system,no-code platform,free no-code development platform' }, + // { name: 'description', content: "NocoBase is a lightweight, extremely scalable open source no-code and low-code development platform. Instead of investing years of time and millions of dollars in research and development, deploy NocoBase in a few minutes and you'll have a private, controllable, and extremely scalable no- code development platform!" }, + // ], + headScripts: process.env.NODE_ENV === 'production' ? [ + ` function hiddenBody() { + const body = document.body; + if (body) { + body.setAttribute('hidden', true); + } else { + requestAnimationFrame(hiddenBody); + } + } + hiddenBody(); + function visibleBody() { + const loading = document.querySelector('.dumi-default-loading-skeleton'); + const headerMenu = document.querySelector('header .ant-menu'); + const antdIsLoaded = headerMenu ? window.getComputedStyle(headerMenu).listStyle === 'outside none none' : false; + if (antdIsLoaded) { + document.body.removeAttribute('hidden'); + } else { + requestAnimationFrame(visibleBody); + } + } + visibleBody();` + ] : [], cacheDirectoryPath: `node_modules/.docs-${lang}-cache`, outputPath: `./dist/${lang}`, resolve: { @@ -81,7 +111,4 @@ export default defineConfig({ '/favicon-32x32.png', '/favicon-16x16.png', ], - sitemap: { - hostname: site_url, - }, }); From 45d8b2824d0b91e7d7bd3b5a9d19a864548196aa Mon Sep 17 00:00:00 2001 From: chenos Date: Tue, 14 Jan 2025 21:41:21 +0800 Subject: [PATCH 2/2] fix: update ci --- .github/workflows/deploy-docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 4e32aac02e..b33fe3d441 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -8,6 +8,7 @@ on: - 'docs/**' - '.github/workflows/deploy-docs.yml' - 'package.json' + - '.dumirc.ts' - '.dumi/theme/**' pull_request: branches: @@ -16,6 +17,8 @@ on: - 'docs/**' - '.github/workflows/deploy-docs.yml' - 'package.json' + - '.dumirc.ts' + - '.dumi/theme/**' jobs: build: