From 5fbc6fef3b43825aee5fe3047fa1b221aff1d767 Mon Sep 17 00:00:00 2001 From: "chen.home" Date: Sun, 3 Mar 2024 14:59:29 +0800 Subject: [PATCH] fix: build error --- build/plugins.ts | 3 +-- vite.config.ts | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/plugins.ts b/build/plugins.ts index 07e1bfe..00bf38f 100644 --- a/build/plugins.ts +++ b/build/plugins.ts @@ -2,7 +2,6 @@ import path from 'node:path' import UnoCSS from '@unocss/vite' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' -import type { PluginOption } from 'vite' import Components from 'unplugin-vue-components/vite' import AutoImport from 'unplugin-auto-import/vite' import { NaiveUiResolver } from 'unplugin-vue-components/resolvers' @@ -20,7 +19,7 @@ import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' * @param {*} env - 环境变量配置 * @return {*} */ -export function setVitePlugins(env: ImportMetaEnv) { +export function createVitePlugins(env: ImportMetaEnv) { const plugins = [ // support vue vue(), diff --git a/vite.config.ts b/vite.config.ts index bf5df6f..b080f6b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,8 @@ import { resolve } from 'node:path' import type { ConfigEnv } from 'vite' import { defineConfig, loadEnv } from 'vite' -import { createViteProxy, setVitePlugins } from './build' +import { createVitePlugins } from './build/plugins' +import { createViteProxy } from './build/proxy' import { proxyConfig } from './src/config' // https://vitejs.dev/config/ @@ -15,7 +16,7 @@ export default defineConfig(({ mode }: ConfigEnv) => { return { base: env.VITE_BASE_URL, - plugins: setVitePlugins(env), + plugins: createVitePlugins(env), resolve: { alias: { '@': resolve(__dirname, 'src'),