mirror of
https://github.com/chansee97/nova-admin.git
synced 2025-04-06 03:57:54 +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 UnoCSS from '@unocss/vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import vueJsx from '@vitejs/plugin-vue-jsx'
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||||
import type { PluginOption } from 'vite'
|
|
||||||
import Components from 'unplugin-vue-components/vite'
|
import Components from 'unplugin-vue-components/vite'
|
||||||
import AutoImport from 'unplugin-auto-import/vite'
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
|
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
|
||||||
@ -20,7 +19,7 @@ import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
|||||||
* @param {*} env - 环境变量配置
|
* @param {*} env - 环境变量配置
|
||||||
* @return {*}
|
* @return {*}
|
||||||
*/
|
*/
|
||||||
export function setVitePlugins(env: ImportMetaEnv) {
|
export function createVitePlugins(env: ImportMetaEnv) {
|
||||||
const plugins = [
|
const plugins = [
|
||||||
// support vue
|
// support vue
|
||||||
vue(),
|
vue(),
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { resolve } from 'node:path'
|
import { resolve } from 'node:path'
|
||||||
import type { ConfigEnv } from 'vite'
|
import type { ConfigEnv } from 'vite'
|
||||||
import { defineConfig, loadEnv } 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'
|
import { proxyConfig } from './src/config'
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
@ -15,7 +16,7 @@ export default defineConfig(({ mode }: ConfigEnv) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
base: env.VITE_BASE_URL,
|
base: env.VITE_BASE_URL,
|
||||||
plugins: setVitePlugins(env),
|
plugins: createVitePlugins(env),
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': resolve(__dirname, 'src'),
|
'@': resolve(__dirname, 'src'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user