fix: compatibility of fs-extra with esm (#4017)

This commit is contained in:
Vben
2024-08-03 09:49:46 +08:00
committed by GitHub
parent bf8a5ffb5d
commit 27ffc9e71b
11 changed files with 78 additions and 33 deletions

View File

@@ -1,7 +1,8 @@
import fs from 'node:fs';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { fs, readPackageJSON } from '@vben/node-utils';
import { readPackageJSON } from '@vben/node-utils';
import { type PluginOption } from 'vite';
@@ -61,7 +62,7 @@ async function getLoadingRawByHtmlTemplate(loadingTemplate: string) {
return;
}
const htmlRaw = await fs.readFile(loadingPath, 'utf8');
const htmlRaw = fs.readFileSync(loadingPath, 'utf8');
return htmlRaw;
}