[feature] deploy to single file

This commit is contained in:
Janis
2023-06-25 22:31:01 +02:00
parent 4ef9d0c3b2
commit 9162aede1a
6 changed files with 57 additions and 35 deletions

19
package-lock.json generated
View File

@@ -22,7 +22,8 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
"typescript": "^5.0.2",
"vite": "^4.3.9"
"vite": "^4.3.9",
"vite-plugin-singlefile": "^0.13.5"
}
},
"node_modules/@esbuild/android-arm": {
@@ -2499,6 +2500,22 @@
}
}
},
"node_modules/vite-plugin-singlefile": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/vite-plugin-singlefile/-/vite-plugin-singlefile-0.13.5.tgz",
"integrity": "sha512-y/aRGh8qHmw2f1IhaI/C6PJAaov47ESYDvUv1am1YHMhpY+19B5k5Odp8P+tgs+zhfvak6QB1ykrALQErEAo7g==",
"dev": true,
"dependencies": {
"micromatch": "^4.0.5"
},
"engines": {
"node": "^14.18.0 || >=16.0.0"
},
"peerDependencies": {
"rollup": ">=2.79.0",
"vite": ">=3.2.0"
}
},
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",

View File

@@ -24,6 +24,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
"typescript": "^5.0.2",
"vite": "^4.3.9"
"vite": "^4.3.9",
"vite-plugin-singlefile": "^0.13.5"
}
}

View File

@@ -44,7 +44,6 @@ export default function App() {
}, []);
useEffect(() => {
console.log("====================================");
setCurrentStates();
}, [clients, channels, connections, activeConnectionId]);

View File

@@ -40,7 +40,7 @@ export class TS5Connection {
name: "TS5 OBS Overlay",
description: "A OBS overlay for TS5 by DerTyp876",
content: {
apiKey: localStorage.getItem("apiKey") || "",
apiKey: localStorage.getItem("apiKey") ?? "",
},
},
};
@@ -51,6 +51,10 @@ export class TS5Connection {
this.ws.send(JSON.stringify(initalPayload));
};
this.ws.onclose = (event) => {
console.log("WebSocket connection closed", event);
};
// Handle messages received from TS5 client
// See TS5MessageHandler class
this.ws.onmessage = (event) => {

View File

@@ -27,7 +27,7 @@
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedLocals": false,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},

View File

@@ -1,5 +1,6 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { viteSingleFile } from "vite-plugin-singlefile"
// https://vitejs.dev/config/
export default defineConfig({
@@ -14,5 +15,5 @@ export default defineConfig({
"@utils": "/src/utils",
},
},
plugins: [react()],
plugins: [react(), viteSingleFile({ useRecommendedBuildConfig: false })],
})