From d63490b984926881626d478004d0176e3bf7334a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C3=96hrlund?= Date: Mon, 25 Sep 2023 21:17:15 +0200 Subject: [PATCH] update vite to use vite-tsconfig-paths to support ts aliases --- garage/package-lock.json | 48 +++++++++++++++++++++++++++++++++++++++- garage/package.json | 3 ++- garage/vite.config.ts | 3 ++- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/garage/package-lock.json b/garage/package-lock.json index de4615f8..581af663 100644 --- a/garage/package-lock.json +++ b/garage/package-lock.json @@ -37,7 +37,8 @@ "typescript": "^5.1.3", "vite": "^4.3.2", "vite-plugin-ejs": "^1.6.4", - "vite-plugin-svgr": "^2.4.0" + "vite-plugin-svgr": "^2.4.0", + "vite-tsconfig-paths": "^4.2.1" } }, "node_modules/@adraffy/ens-normalize": { @@ -5976,6 +5977,12 @@ "node": ">=4" } }, + "node_modules/globrex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", + "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", + "dev": true + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -8605,6 +8612,26 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/tsconfck": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-2.1.2.tgz", + "integrity": "sha512-ghqN1b0puy3MhhviwO2kGF8SeMDNhEbnKxjK7h6+fvY9JAxqvXi8y5NAHSQv687OVboS2uZIByzGd45/YxrRHg==", + "dev": true, + "bin": { + "tsconfck": "bin/tsconfck.js" + }, + "engines": { + "node": "^14.13.1 || ^16 || >=18" + }, + "peerDependencies": { + "typescript": "^4.3.5 || ^5.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/tslib": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", @@ -9063,6 +9090,25 @@ "vite": "^2.6.0 || 3 || 4" } }, + "node_modules/vite-tsconfig-paths": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.2.1.tgz", + "integrity": "sha512-GNUI6ZgPqT3oervkvzU+qtys83+75N/OuDaQl7HmOqFTb0pjZsuARrRipsyJhJ3enqV8beI1xhGbToR4o78nSQ==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "globrex": "^0.1.2", + "tsconfck": "^2.1.0" + }, + "peerDependencies": { + "vite": "*" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, "node_modules/wagmi": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/wagmi/-/wagmi-1.2.2.tgz", diff --git a/garage/package.json b/garage/package.json index 216fcf5d..b632d171 100644 --- a/garage/package.json +++ b/garage/package.json @@ -38,6 +38,7 @@ "typescript": "^5.1.3", "vite": "^4.3.2", "vite-plugin-ejs": "^1.6.4", - "vite-plugin-svgr": "^2.4.0" + "vite-plugin-svgr": "^2.4.0", + "vite-tsconfig-paths": "^4.2.1" } } diff --git a/garage/vite.config.ts b/garage/vite.config.ts index ca0071d3..e58a4829 100644 --- a/garage/vite.config.ts +++ b/garage/vite.config.ts @@ -2,10 +2,11 @@ import { defineConfig } from "vite"; import { ViteEjsPlugin } from "vite-plugin-ejs"; import svgr from "vite-plugin-svgr"; import react from "@vitejs/plugin-react"; +import tsconfigPaths from "vite-tsconfig-paths"; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [svgr(), react(), ViteEjsPlugin()], + plugins: [svgr(), react(), ViteEjsPlugin(), tsconfigPaths()], optimizeDeps: { exclude: ["@tableland/sqlparser"], },