import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; import {resolve} from 'path'; // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue()], resolve:{ alias:{ '~': resolve(__dirname, './'), "@": resolve(__dirname, "./src"), "@api": resolve(__dirname, "./src/api"), "@assets": resolve(__dirname, "./src/assets"), "@components": resolve(__dirname, "./src/components"), "@store": resolve(__dirname, "./src/store"), "@views": resolve(__dirname, "./src/views"), } }, server: { host: true, // 类型:string | boolean 指定服务器应该监听哪个 IP 地址 port: 3100, // 类型: number 指定服务器端口 cors: true, // 类型: boolean | CorsOptions 为开发服务器配置 CORS。默认启用并允许任何源 hmr : true }, css: { preprocessorOptions: { less: { javascriptEnabled: true, // do not remove this line } } }, })