mirror of
https://github.com/chansee97/nova-admin.git
synced 2025-04-05 04:22:49 +08:00
fix: build error
This commit is contained in:
parent
3c1b1e2336
commit
5fbc6fef3b
@ -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(),
|
||||
|
@ -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'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user