mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-03-08 07:31:09 +08:00
fix: vite.config.mts type error (#7081)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import type { DefineConfig } from '../typing';
|
import type { DefineConfig, VbenViteConfig } from '../typing';
|
||||||
|
|
||||||
import { existsSync } from 'node:fs';
|
import { existsSync } from 'node:fs';
|
||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
@@ -12,7 +12,7 @@ export * from './library';
|
|||||||
function defineConfig(
|
function defineConfig(
|
||||||
userConfigPromise?: DefineConfig,
|
userConfigPromise?: DefineConfig,
|
||||||
type: 'application' | 'auto' | 'library' = 'auto',
|
type: 'application' | 'auto' | 'library' = 'auto',
|
||||||
) {
|
): VbenViteConfig {
|
||||||
let projectType = type;
|
let projectType = type;
|
||||||
|
|
||||||
// 根据包是否存在 index.html,自动判断类型
|
// 根据包是否存在 index.html,自动判断类型
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
import type { PluginVisualizerOptions } from 'rollup-plugin-visualizer';
|
import type { PluginVisualizerOptions } from 'rollup-plugin-visualizer';
|
||||||
import type { ConfigEnv, PluginOption, UserConfig } from 'vite';
|
import type {
|
||||||
|
ConfigEnv,
|
||||||
|
PluginOption,
|
||||||
|
UserConfig,
|
||||||
|
UserConfigFnPromise,
|
||||||
|
} from 'vite';
|
||||||
import type { PluginOptions } from 'vite-plugin-dts';
|
import type { PluginOptions } from 'vite-plugin-dts';
|
||||||
import type { Options as PwaPluginOptions } from 'vite-plugin-pwa';
|
import type { Options as PwaPluginOptions } from 'vite-plugin-pwa';
|
||||||
|
|
||||||
@@ -327,6 +332,8 @@ type DefineLibraryOptions = (config?: ConfigEnv) => Promise<{
|
|||||||
*/
|
*/
|
||||||
type DefineConfig = DefineApplicationOptions | DefineLibraryOptions;
|
type DefineConfig = DefineApplicationOptions | DefineLibraryOptions;
|
||||||
|
|
||||||
|
type VbenViteConfig = Promise<UserConfig> | UserConfig | UserConfigFnPromise;
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
ApplicationPluginOptions,
|
ApplicationPluginOptions,
|
||||||
ArchiverPluginOptions,
|
ArchiverPluginOptions,
|
||||||
@@ -340,4 +347,5 @@ export type {
|
|||||||
LibraryPluginOptions,
|
LibraryPluginOptions,
|
||||||
NitroMockPluginOptions,
|
NitroMockPluginOptions,
|
||||||
PrintPluginOptions,
|
PrintPluginOptions,
|
||||||
|
VbenViteConfig,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user