refactor(web): drop vite-tsconfig-paths in favor of resolve.alias
Quentin Gliech
and
Claude Opus 4.6 (1M context)
created 1 month ago
Vite 8 no longer needs the plugin. Use resolve.alias to map @/* to
src/* directly, silencing the deprecation warning on every build/test.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change summary
webui2/package.json | 1 -
webui2/pnpm-lock.yaml | 37 -------------------------------------
webui2/vite.config.ts | 11 +++++++++--
3 files changed, 9 insertions(+), 40 deletions(-)
Detailed changes
@@ -75,7 +75,6 @@
"typescript": "^6.0.2",
"vite": "^8.0.3",
"vite-plugin-svgr": "^5.0.0",
- "vite-tsconfig-paths": "^6.1.1",
"vitest": "^4.1.2"
},
"packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319"
@@ -174,9 +174,6 @@ importers:
vite-plugin-svgr:
specifier: ^5.0.0
version: 5.0.0(typescript@6.0.2)(vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(esbuild@0.27.4)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.3))
- vite-tsconfig-paths:
- specifier: ^6.1.1
- version: 6.1.1(typescript@6.0.2)(vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(esbuild@0.27.4)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.3))
vitest:
specifier: ^4.1.2
version: 4.1.2(@types/node@25.5.0)(@vitest/browser-playwright@4.1.2)(happy-dom@20.8.9)(jsdom@29.0.1)(vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(esbuild@0.27.4)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.3))
@@ -3287,9 +3284,6 @@ packages:
resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
engines: {node: '>=10'}
- globrex@0.1.2:
- resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==}
-
graceful-fs@4.2.11:
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
@@ -4541,16 +4535,6 @@ packages:
ts-log@2.2.7:
resolution: {integrity: sha512-320x5Ggei84AxzlXp91QkIGSw5wgaLT6GeAH0KsqDmRZdVWW2OiSeVvElVoatk3f7nicwXlElXsoFkARiGE2yg==}
- tsconfck@3.1.6:
- resolution: {integrity: sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==}
- engines: {node: ^18 || >=20}
- hasBin: true
- peerDependencies:
- typescript: ^5.0.0
- peerDependenciesMeta:
- typescript:
- optional: true
-
tsconfig-paths@4.2.0:
resolution: {integrity: sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==}
engines: {node: '>=6'}
@@ -4687,11 +4671,6 @@ packages:
peerDependencies:
vite: '>=3.0.0'
- vite-tsconfig-paths@6.1.1:
- resolution: {integrity: sha512-2cihq7zliibCCZ8P9cKJrQBkfgdvcFkOOc3Y02o3GWUDLgqjWsZudaoiuOwO/gzTzy17cS5F7ZPo4bsnS4DGkg==}
- peerDependencies:
- vite: '*'
-
vite@8.0.3:
resolution: {integrity: sha512-B9ifbFudT1TFhfltfaIPgjo9Z3mDynBTJSUYxTjOQruf/zHH+ezCQKcoqO+h7a9Pw9Nm/OtlXAiGT1axBgwqrQ==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -8018,8 +7997,6 @@ snapshots:
merge2: 1.4.1
slash: 3.0.0
- globrex@0.1.2: {}
-
graceful-fs@4.2.11: {}
graphql-config@5.1.6(@types/node@25.5.0)(graphql@16.13.2)(typescript@6.0.2):
@@ -9632,10 +9609,6 @@ snapshots:
ts-log@2.2.7: {}
- tsconfck@3.1.6(typescript@6.0.2):
- optionalDependencies:
- typescript: 6.0.2
-
tsconfig-paths@4.2.0:
dependencies:
json5: 2.2.3
@@ -9785,16 +9758,6 @@ snapshots:
- supports-color
- typescript
- vite-tsconfig-paths@6.1.1(typescript@6.0.2)(vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(esbuild@0.27.4)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.3)):
- dependencies:
- debug: 4.4.3
- globrex: 0.1.2
- tsconfck: 3.1.6(typescript@6.0.2)
- vite: 8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(esbuild@0.27.4)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.3)
- transitivePeerDependencies:
- - supports-color
- - typescript
-
vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(esbuild@0.27.4)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.3):
dependencies:
lightningcss: 1.32.0
@@ -1,9 +1,12 @@
import tailwindcss from "@tailwindcss/vite";
import { tanstackRouter } from "@tanstack/router-plugin/vite";
import react from "@vitejs/plugin-react";
+import path from "node:path";
+import { fileURLToPath } from "node:url";
import { defineConfig } from "vite";
import svgr from "vite-plugin-svgr";
-import tsconfigPaths from "vite-tsconfig-paths";
+
+const dirname = path.dirname(fileURLToPath(import.meta.url));
// The Go backend URL. Run: git-bug webui --port 3000
const API_URL = process.env.VITE_API_URL || "http://localhost:3000";
@@ -11,11 +14,15 @@ const API_URL = process.env.VITE_API_URL || "http://localhost:3000";
export default defineConfig({
plugins: [
tanstackRouter({ target: "react", autoCodeSplitting: true }),
- tsconfigPaths(),
svgr(),
tailwindcss(),
react(),
],
+ resolve: {
+ alias: {
+ "@": path.resolve(dirname, "src"),
+ },
+ },
server: {
proxy: {
"/graphql": { target: API_URL, changeOrigin: true },