fix: build error

This commit is contained in:
chen.home 2024-03-03 14:59:29 +08:00
parent 3c1b1e2336
commit 5fbc6fef3b
2 changed files with 4 additions and 4 deletions

View File

@ -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(),

View File

@ -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'),