diff --git a/package-lock.json b/package-lock.json index dc05754..abb9c33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "ts5-obs-overlay", "version": "0.0.0", "dependencies": { + "@types/node": "^20.3.2", "jest": "^29.5.0", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/package.json b/package.json index 92bcfc6..3019f60 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "preview": "vite preview" }, "dependencies": { + "@types/node": "^20.3.2", "jest": "^29.5.0", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/src/App.tsx b/src/App.tsx index 29e9592..1d46896 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,10 +1,10 @@ /* eslint-disable react-hooks/exhaustive-deps */ import "@styles/App.scss"; -import { IChannel, IClient, IConnection, ITS5ConnectionHandler } from "interfaces/teamspeak"; +import { IChannel, IClient, IConnection, ITS5ConnectionHandler } from "@interfaces/teamspeak"; import { useEffect, useState } from "react"; import Viewer from "./Viewer"; import { useSearchParams } from "react-router-dom"; -import { TS5ConnectionHandler } from "handlers/teamspeak/connectionHandler"; +import { TS5ConnectionHandler } from "@handlers/teamspeak/connectionHandler"; export default function App() { const [searchParams] = useSearchParams(); diff --git a/tsconfig.json b/tsconfig.json index b0ed0c7..3e8c6b5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,16 +6,15 @@ "module": "ESNext", "skipLibCheck": true, - "baseUrl": "./src", - + "baseUrl": ".", "paths": { - "@/*": ["/src/*"], - "@components/*": ["/src/components/*"], - "@assets/*": ["/src/assets/*"], - "@styles/*": ["/src/styles/*"], - "@utils/*": ["/src/utils/*"], - "@interfaces/*": ["/src/interfaces/*"], - "@handlers/*": ["/src/handlers/*"] + "@/*": ["src/*"], + "@components/*": ["src/components/*"], + "@assets/*": ["src/assets/*"], + "@styles/*": ["src/styles/*"], + "@utils/*": ["src/utils/*"], + "@interfaces/*": ["src/interfaces/*"], + "@handlers/*": ["src/handlers/*"] }, /* Bundler mode */ @@ -32,6 +31,6 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true }, - "include": ["src", "tests/teamspeakHandler.test.ts"], + "include": ["src"], "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/vite.config.ts b/vite.config.ts index 955da82..a6ccc16 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,19 +1,20 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react-swc' import { viteSingleFile } from "vite-plugin-singlefile" +import path from 'path'; // https://vitejs.dev/config/ export default defineConfig({ base: "./", resolve: { alias: { - "@": "/src", - "@components": "/src/components", - "@styles": "/src/styles", - "@assets": "/src/assets", - "@interfaces": "/src/interfaces", - "@utils": "/src/utils", - "@handlers": "/src/handlers", + '@': path.resolve(__dirname, './src'), + '@assets': path.resolve(__dirname, './src/assets'), + '@components': path.resolve(__dirname, './src/components'), + '@handlers': path.resolve(__dirname, './src/handlers'), + '@interfaces': path.resolve(__dirname, './src/interfaces'), + '@utils': path.resolve(__dirname, './src/utils'), + '@styles': path.resolve(__dirname, './src/styles'), }, }, plugins: [react(), viteSingleFile({ useRecommendedBuildConfig: false })],