36 lines
805 B
TypeScript
36 lines
805 B
TypeScript
import {fileURLToPath, URL} from 'node:url'
|
|
|
|
import {defineConfig} from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
|
|
//
|
|
// const {createProxyMiddleware} = require('http-proxy-middleware');
|
|
// app.use('/api', createProxyMiddleware({
|
|
// target: '/https:/v3pz.itndedu.com/v3pz/',
|
|
// changeOrigin: true,
|
|
// pathRewrite: {'^/api': ''}
|
|
// }));
|
|
//
|
|
// // https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
vueJsx(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: 'https://v3pz.itndedu.com/v3pz/',
|
|
changeOrigin: true,
|
|
rewrite: (path): any => path.replace("/api", ''),
|
|
},
|
|
},
|
|
},
|
|
})
|