mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 15:08:47 -07:00
c5db16eeb0
Three carry-overs from the march branch (commits80cc4ce,cd9d105) and the launcher-side Vite build fix, all applicable to december without modification: 1. Vite admin-ui + site configs switch from `base: '/'` to `base: './'`. Built index.html now emits `<script src="./assets/...">` instead of `/assets/...`, so the Easy Launcher's single-origin path-prefix mode (`https://<apex>/__dn/admin/`) resolves assets under the prefix instead of skipping it and 404'ing on the wrong server host. 2. Mod.ResolveType promoted from private to internal so PhotonPatches' and SavePatches' local FindGameType helpers can delegate to the broader assembly-scan fallback (was misssing IL2CPP-mangled type names like the literal "PhotonNetwork"). Both helpers collapse to one-line `=> Mod.ResolveType(name);`. 3. Parked AuthValuesInjector_Prefix into DorkNet.ClientMod/attic/AuthValuesInjector.cs.attic. In december this method was defined but **never wired to a harmony hook** in OnLateInitializeMelon, so it was effectively dead code. Removed the method + GetCurrentLockToken helper + Cfg.InjectAuthValues field + LoadConfig reader + log mention. The .cs.attic suffix keeps the SDK's auto-globber from compiling the parked file. Restore notes inside the attic file describe how to re-enable — for december the suggested hook is a postfix on PUNNetworkManager.EMGGKBALALH (mutate the AuthValues there) instead of march's NetworkingPeer.CallAuthenticate which never fires in IL2CPP.
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import path from 'node:path';
|
|
|
|
// Source lives at DorkNet.Server/admin-ui; build emits straight into
|
|
// DorkNet.Server/wwwroot/admin so the static file middleware picks it
|
|
// up at admin.localhost without any extra publish wiring.
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
// Relative-base so the built index.html references its assets as
|
|
// `./assets/...` instead of `/assets/...`. Required when the SPA is
|
|
// served under a path prefix like the Easy Launcher's single-origin
|
|
// mode (`https://<apex>/__dn/admin/`) — a root-absolute asset path
|
|
// would skip the /__dn/admin/ prefix and 404 on the wrong server
|
|
// host. Still works fine for the subdomain case
|
|
// (`admin.<apex>/...`) since `./assets/...` resolves against the
|
|
// document URL in both shapes.
|
|
base: './',
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
build: {
|
|
outDir: path.resolve(__dirname, '../wwwroot/admin'),
|
|
emptyOutDir: true,
|
|
target: 'es2022',
|
|
sourcemap: true,
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
// Dev convenience: `npm run dev` proxies API calls to the
|
|
// running ASP.NET server so we can iterate on the SPA with HMR
|
|
// without dealing with CORS. Adjust target if the server runs
|
|
// on a non-default port locally.
|
|
'/api': {
|
|
target: 'http://localhost:80',
|
|
changeOrigin: true,
|
|
secure: false,
|
|
},
|
|
},
|
|
},
|
|
});
|