You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.0 KiB

/*
* @Author: limingyuan 13613947821@163.com
* @Date: 2024-01-03 08:40:07
* @LastEditors: limingyuan 13613947821@163.com
* @LastEditTime: 2024-01-05 08:52:55
* @FilePath: \rms-terminal-frontend-portrait\vite.config.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { fileURLToPath, URL } from 'node:url'
import path from "path";
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite';
import { VantResolver } from 'unplugin-vue-components/resolvers';
import legacy from '@vitejs/plugin-legacy';
export default defineConfig({
base: "./",
plugins: [
vue(),
Components({
resolvers: [VantResolver()],
}),
legacy({
targets: ["defaults", "not IE 11"],
})
],
resolve: {
alias: {
// '@': fileURLToPath(new URL('./src', import.meta.url))
"@": path.resolve(__dirname, "./src"),
}
},
build: {
outDir: './dist',
emptyOutDir: true
},
css: {
preprocessorOptions: {
less: {
charset: false,
additionalData: "@import './src/assets/globle.less';"
}
}
},
server: {
hmr: true,
proxy: {
'/api/rms': {
// target: 'http://127.0.0.1:8000/api/',
// target: 'http://192.168.2.226:8000/api/', eagle90
// target: 'http://192.168.100.78:8000/api/',
// target: 'http://192.168.100.78:8000/api/',
// target: 'http://192.168.0.66:8000/api/',
// target: 'http://192.168.2.117:8000/api/',
// target: 'http://192.168.2.100:8000/api/', //展厅
target: 'http://192.168.100.64:8000/api/', //曹工
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
},
'/api/cabinet': {
target: 'http://127.0.0.1:80/api/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
},
})