chore: disable mako outside MacOS and Linux (#50837)

Co-authored-by: liuyuan <yuanliu147@qq.com>
Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
yuanliu 2024-09-14 15:16:47 +08:00 committed by GitHub
parent a63b9e9ffa
commit 388203ff0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,7 @@
import path from 'path'; import path from 'path';
import { defineConfig } from 'dumi'; import { defineConfig } from 'dumi';
import * as fs from 'fs-extra'; import * as fs from 'fs-extra';
import os from 'node:os';
import rehypeAntd from './.dumi/rehypeAntd'; import rehypeAntd from './.dumi/rehypeAntd';
import remarkAntd from './.dumi/remarkAntd'; import remarkAntd from './.dumi/remarkAntd';
@ -21,7 +22,7 @@ export default defineConfig({
: false, : false,
hash: true, hash: true,
mfsu: false, mfsu: false,
mako: {}, mako: ['Darwin', 'Linux'].includes(os.type()) ? {} : false,
crossorigin: {}, crossorigin: {},
runtimePublicPath: {}, runtimePublicPath: {},
outputPath: '_site', outputPath: '_site',
@ -57,9 +58,12 @@ export default defineConfig({
analytics: { analytics: {
ga_v2: 'UA-72788897-1', ga_v2: 'UA-72788897-1',
}, },
analyze: process.env.NODE_ENV === 'production' ? false : { analyze:
analyzerPort: 'auto', process.env.NODE_ENV === 'production'
}, ? false
: {
analyzerPort: 'auto',
},
links: [ links: [
{ {
rel: 'prefetch', rel: 'prefetch',