diff --git a/package.json b/package.json index b2ab1c6..d4a8995 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "vite": "^7.0.6", "vite-plugin-checker": "^0.10.2", "vite-plugin-vue-devtools": "^8.0.0", + "vite-tsconfig-paths": "^5.1.4", "vue-tsc": "^3.0.4" }, "volta": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 28e98d5..bfa2f45 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -81,6 +81,9 @@ importers: vite-plugin-vue-devtools: specifier: ^8.0.0 version: 8.0.0(vite@7.1.2(@types/node@22.17.1)(jiti@2.5.1)(less@4.4.0))(vue@3.5.18(typescript@5.8.3)) + vite-tsconfig-paths: + specifier: ^5.1.4 + version: 5.1.4(typescript@5.8.3)(vite@7.1.2(@types/node@22.17.1)(jiti@2.5.1)(less@4.4.0)) vue-tsc: specifier: ^3.0.4 version: 3.0.5(typescript@5.8.3) @@ -1423,6 +1426,9 @@ packages: resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} engines: {node: '>= 0.4'} + globrex@0.1.2: + resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} @@ -2168,6 +2174,16 @@ packages: peerDependencies: typescript: '>=4.8.4' + 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@3.15.0: resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} @@ -2301,6 +2317,14 @@ packages: peerDependencies: vite: ^3.0.0-0 || ^4.0.0-0 || ^5.0.0-0 || ^6.0.0-0 || ^7.0.0-0 + vite-tsconfig-paths@5.1.4: + resolution: {integrity: sha512-cYj0LRuLV2c2sMqhqhGpaO3LretdtMn/BVX4cPLanIZuwwrkVl+lK84E/miEXkCHWXuq65rhNN4rXsBcOB3S4w==} + peerDependencies: + vite: '*' + peerDependenciesMeta: + vite: + optional: true + vite@7.1.2: resolution: {integrity: sha512-J0SQBPlQiEXAF7tajiH+rUooJPo0l8KQgyg4/aMunNtrOa7bwuZJsJbDWzeljqQpgftxuq5yNJxQ91O9ts29UQ==} engines: {node: ^20.19.0 || >=22.12.0} @@ -3904,6 +3928,8 @@ snapshots: define-properties: 1.2.1 gopd: 1.2.0 + globrex@0.1.2: {} + gopd@1.2.0: {} graceful-fs@4.2.11: @@ -4628,6 +4654,10 @@ snapshots: dependencies: typescript: 5.8.3 + tsconfck@3.1.6(typescript@5.8.3): + optionalDependencies: + typescript: 5.8.3 + tsconfig-paths@3.15.0: dependencies: '@types/json5': 0.0.29 @@ -4812,6 +4842,17 @@ snapshots: transitivePeerDependencies: - supports-color + vite-tsconfig-paths@5.1.4(typescript@5.8.3)(vite@7.1.2(@types/node@22.17.1)(jiti@2.5.1)(less@4.4.0)): + dependencies: + debug: 4.4.1 + globrex: 0.1.2 + tsconfck: 3.1.6(typescript@5.8.3) + optionalDependencies: + vite: 7.1.2(@types/node@22.17.1)(jiti@2.5.1)(less@4.4.0) + transitivePeerDependencies: + - supports-color + - typescript + vite@7.1.2(@types/node@22.17.1)(jiti@2.5.1)(less@4.4.0): dependencies: esbuild: 0.25.8 diff --git a/src/router/index.ts b/src/router/index.ts index 9ad71a8..b56cdcf 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,6 +1,6 @@ import { createRouter, createWebHistory } from 'vue-router' -import HomeView from '../views/HomeView.vue' +import HomeView from '@/views/HomeView.vue' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), diff --git a/vite.config.ts b/vite.config.ts index ea5713f..7411ed5 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,9 +1,9 @@ import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' -import { fileURLToPath, URL } from 'node:url' import { defineConfig } from 'vite' import checker from 'vite-plugin-checker' import vueDevTools from 'vite-plugin-vue-devtools' +import tsconfigPaths from 'vite-tsconfig-paths' // https://vite.dev/config/ export default defineConfig({ @@ -18,10 +18,6 @@ export default defineConfig({ eslint: { useFlatConfig: true, lintCommand: 'eslint "./src/**/*.{ts,tsx,vue}"' }, vueTsc: true, }), + tsconfigPaths(), ], - resolve: { - alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)), - }, - }, })