[fix] aliases

This commit is contained in:
Janis Meister
2023-06-29 12:51:58 +02:00
parent 98deb4db19
commit e5f4e7b4fa
5 changed files with 21 additions and 19 deletions

1
package-lock.json generated
View File

@@ -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",

View File

@@ -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",

View File

@@ -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();

View File

@@ -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" }]
}

View File

@@ -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 })],