fix: element theme adjustment

This commit is contained in:
vben
2024-07-31 22:11:24 +08:00
parent 1c9525a013
commit 9a6e29c401
21 changed files with 80 additions and 52 deletions

View File

@@ -30,6 +30,7 @@
"@intlify/unplugin-vue-i18n": "^4.0.0",
"@jspm/generator": "^2.1.2",
"cheerio": "1.0.0-rc.12",
"get-port": "^7.1.0",
"html-minifier-terser": "^7.2.0",
"nitropack": "^2.9.7",
"resolve.exports": "^2.0.2",

View File

@@ -4,6 +4,7 @@ import type { NitroMockPluginOptions } from '../typing';
import { colors, consola, getPackage } from '@vben/node-utils';
import getPort from 'get-port';
import { build, createDevServer, createNitro, prepare } from 'nitropack';
const hmrKeyRe = /^runtimeConfig\.|routeRules\./;
@@ -15,6 +16,11 @@ export const viteNitroMockPlugin = ({
}: NitroMockPluginOptions = {}): PluginOption => {
return {
async configureServer(server) {
const availablePort = await getPort({ port });
if (availablePort !== port) {
return;
}
const pkg = await getPackage(mockServerPackage);
if (!pkg) {
consola.error(`Package ${mockServerPackage} not found.`);