import { defineConfig, normalizePath } from 'vite' import vue from '@vitejs/plugin-vue' import TurboConsole from 'unplugin-turbo-console/vite' import { viteStaticCopy } from 'vite-plugin-static-copy' import vueJsx from '@vitejs/plugin-vue-jsx' import * as path from "node:path"; // https://vite.dev/config/ export default defineConfig({ resolve: { alias: { '@': path.resolve(__dirname, 'src'), }, }, plugins: [ vue(), // TurboConsole({ // // 配置选项 // launchEditor: { // specifiedEditor: 'webstorm', // }, // }), viteStaticCopy({ targets: [ { src: normalizePath(path.resolve(__dirname, "../sdk/public/**/*")), dest: ".", rename: { stripBase: 2 } } ] }), vueJsx({ // options are passed on to @vue/babel-plugin-jsx }), ], // 开发服务器配置 server: { // 监听所有网络接口(0.0.0.0),允许外部IP访问 host: '0.0.0.0', // 可选:指定端口(如8099,和你之前的Caddy端口一致) port: 8099, // 可选:端口被占用时自动切换可用端口 strictPort: false, // 可选:自动打开浏览器 // open: true } })