x
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import {
|
||||
defineConfig
|
||||
} from 'vite'
|
||||
import uni from '@dcloudio/vite-plugin-uni'
|
||||
import path from 'path'
|
||||
export default defineConfig({
|
||||
plugins: [uni()],
|
||||
// 新增服务器配置,指定启动端口
|
||||
server: {
|
||||
port: 5174,
|
||||
strictPort: true, // 可选:端口被占用时直接报错(避免自动切换端口)
|
||||
open: false // 可选:启动后自动打开浏览器(按需开启)
|
||||
},
|
||||
base: './', // 关键:设置基础路径为相对路径
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
assetsDir: 'assets' // 和打包后的目录一致
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user