单页应用的兜底原本对任何找不到的路径都回 index.html,包括带扩展名的资源。 资源文件是带哈希的,每次打包换名字,浏览器缓存了旧 index.html 时会去请求一个已经 不存在的 .js,然后拿到一份 HTML,报出「MIME 类型不对」——一句完全指不到病根的错误。 现在带扩展名的路径找不到就回 404,index.html 也不再允许缓存。 另外 dev:all 一条命令同时起后端(--hot)和前端(Vite),省掉记两个终端和两个端口。
34 lines
985 B
JSON
34 lines
985 B
JSON
{
|
|
"name": "patchbay",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"description": "mihomo 配置的网页界面:把每一路入站接到它自己的出站上",
|
|
"scripts": {
|
|
"start": "vite build && bun run server/index.ts",
|
|
"dev": "bun run --hot server/index.ts",
|
|
"dev:all": "bun run scripts/dev-all.ts",
|
|
"dev:web": "vite",
|
|
"dev:kernel": "../binary/mihomo-windows-amd64-v3-go125.exe -d dev/home -f dev/home/config.yaml",
|
|
"dev:reset": "bun run scripts/dev-reset.ts",
|
|
"build": "vite build",
|
|
"test": "bun test",
|
|
"smoke": "bun run scripts/api-smoke.ts",
|
|
"typecheck": "vue-tsc --noEmit"
|
|
},
|
|
"dependencies": {
|
|
"yaml": "^2.9.0",
|
|
"vue": "^3.5.13"
|
|
},
|
|
"devDependencies": {
|
|
"@iconify-json/ri": "^1.2.10",
|
|
"@iconify/utils": "^3.1.4",
|
|
"@types/bun": "latest",
|
|
"@vitejs/plugin-vue": "^6.0.0",
|
|
"typescript": "^5.7.3",
|
|
"unplugin-icons": "^23.0.1",
|
|
"vite": "^7.0.0",
|
|
"vue-tsc": "^3.0.0"
|
|
}
|
|
}
|