import { defineConfig } from 'vite'
import { resolve } from "path";
import vue from '@vitejs/plugin-vue'
import vueJsx from "@vitejs/plugin-vue-jsx";
function pathResolve(dir) {
return resolve(__dirname, ".", dir);
}
export default defineConfig({
plugins: [vue(), vueJsx()],
resolve: {
alias: {
"/@": pathResolve("src"),
}
},
optimizeDeps: {
include: ['axios'],
},
build: {
target: 'modules',
outDir: 'dist',
assetsDir: 'assets',
sourcemap: false,
minify: 'terser'
},
server: {
host: 'localhost',
port: 3000,
open: true,
strictPort: false,
https: false,
cors: true,
proxy: {
'/api': {
target: 'http://192.168.1.122:3000',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
}
})