|
@@ -3,22 +3,19 @@ import vue from '@vitejs/plugin-vue'
|
|
|
import Components from "unplugin-vue-components/vite";
|
|
|
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
|
|
|
|
|
|
-const port = process.argv.includes('--port')
|
|
|
- ? process.argv[process.argv.indexOf('--port') + 1]
|
|
|
- : 3000; // 默认端口为3000
|
|
|
+const port = process.env.PORT ? parseInt(process.env.PORT) : 3000;
|
|
|
|
|
|
-// https://vite.dev/config/
|
|
|
export default defineConfig({
|
|
|
plugins: [
|
|
|
vue(),
|
|
|
Components({
|
|
|
- resolvers: [AntDesignVueResolver({ importStyle: false })],
|
|
|
- }),],
|
|
|
- // base: `/ide2/proxy/${port}/`,
|
|
|
- base: `/prototype/${port}/`,
|
|
|
+ resolvers: [AntDesignVueResolver({ importStyle: false })],
|
|
|
+ })
|
|
|
+ ],
|
|
|
+ base: `/ide/proxy/${port}/`,
|
|
|
server: {
|
|
|
host: '0.0.0.0', // 监听所有网络
|
|
|
- port: Number(port), // 确保端口匹配
|
|
|
+ port, // 确保端口匹配
|
|
|
strictPort: true, // 保证端口不会被其他程序占用
|
|
|
watch: {
|
|
|
usePolling: true
|