Files
xk-of-view/vite.config.js

43 lines
1.1 KiB
JavaScript
Raw Normal View History

2025-04-24 13:39:24 +08:00
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
2025-05-15 21:24:56 +08:00
import tailwindcss from "@tailwindcss/vite"
import path from 'path'
2025-04-24 13:39:24 +08:00
// https://vite.dev/config/
export default defineConfig({
plugins: [
vue(),
tailwindcss()
],
2025-05-15 21:24:56 +08:00
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
server: {
2025-06-09 16:51:58 +08:00
port: 10186,
2025-05-15 21:24:56 +08:00
proxy: {
'/api': {
// target: 'http://127.0.0.1:18007/api/',
2026-07-18 05:57:07 +08:00
target: 'http://127.0.0.1:8000/api/',
2025-05-15 21:24:56 +08:00
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
2025-06-09 16:51:58 +08:00
},
build: {
assetsDir: 'assets/images',
rollupOptions: {
output: {
assetFileNames: (assetInfo) => {
let extType = assetInfo.name.split('.').at(1);
if (/png|jpe?g|svg|gif|tiff|bmp|ico/i.test(extType)) {
return `assets/images/[name]-[hash][extname]`;
}
return `assets/[name]-[hash][extname]`;
}
}
}
2025-05-15 21:24:56 +08:00
}
2025-04-24 13:39:24 +08:00
})