perf: Improve the global loading display

This commit is contained in:
vben
2024-06-02 23:50:58 +08:00
parent e650a0b863
commit 77d40dc763
14 changed files with 111 additions and 57 deletions

View File

@@ -7,11 +7,11 @@ import { defineConfig, loadEnv, mergeConfig } from 'vite';
import { getApplicationConditionPlugins } from '../plugins';
import { getCommonConfig } from './common';
import type { DefineAppcationOptions } from '../typing';
import type { DefineApplicationOptions } from '../typing';
function defineApplicationConfig(options: DefineAppcationOptions = {}) {
function defineApplicationConfig(options: DefineApplicationOptions = {}) {
return defineConfig(async ({ command, mode }) => {
const { appcation = {}, vite = {} } = options;
const { application = {}, vite = {} } = options;
const root = process.cwd();
const isBuild = command === 'build';
const env = loadEnv(mode, root);
@@ -29,11 +29,10 @@ function defineApplicationConfig(options: DefineAppcationOptions = {}) {
mock: true,
mode,
turboConsole: false,
...appcation,
...application,
});
const applicationConfig: UserConfig = {
// },
build: {
rollupOptions: {
output: {
@@ -44,7 +43,6 @@ function defineApplicationConfig(options: DefineAppcationOptions = {}) {
},
target: 'es2015',
},
// },
esbuild: {
drop: isBuild
? [