53 lines
1.3 KiB
TypeScript
53 lines
1.3 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
|
import uncomponents from 'unplugin-vue-components/vite'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
vueJsx(),
|
|
tailwindcss(),
|
|
uncomponents({
|
|
dts: true,
|
|
dirs: ['src/components/'],
|
|
allowOverrides: true,
|
|
directoryAsNamespace: true,
|
|
}),
|
|
AutoImport({
|
|
imports: ['vue', 'vue-router', '@vueuse/core'],
|
|
include: [
|
|
/\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
|
|
/\.vue$/,
|
|
/\.vue\?vue/, // .vue
|
|
],
|
|
dts: 'src/types/auto-imports.d.ts', // specify the dts file path
|
|
}),
|
|
],
|
|
server: {
|
|
host: '0.0.0.0',
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://127.0.0.1:47173/api',
|
|
changeOrigin: false,
|
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
|
},
|
|
'/image': {
|
|
target: 'http://127.0.0.1:3000',
|
|
changeOrigin: false,
|
|
rewrite: (path) => path.replace(/^\/image/, ''),
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
})
|