From 6e5a018906d4a9e26dc01526382f8133515cedbc Mon Sep 17 00:00:00 2001 From: Dongja Date: Wed, 1 Nov 2023 17:07:20 +0900 Subject: [PATCH] =?UTF-8?q?chore=20:=20vite=20=EC=A0=88=EB=8C=80=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=EC=84=A4=EC=A0=95=20(#15)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(common): vite 절대 경로 설정 * chore(common): lint-staged에서 prettier --write 제거 --- .lintstagedrc | 2 +- apps/shelter/package.json | 3 ++- apps/shelter/tsconfig.json | 8 +++++++- apps/shelter/vite.config.ts | 3 +++ apps/volunteer/package.json | 1 + apps/volunteer/tsconfig.json | 8 +++++++- apps/volunteer/vite.config.ts | 3 +++ pnpm-lock.yaml | 22 +++++++++++++++++----- 8 files changed, 41 insertions(+), 9 deletions(-) diff --git a/.lintstagedrc b/.lintstagedrc index 51718e21..69f83f8a 100644 --- a/.lintstagedrc +++ b/.lintstagedrc @@ -1,3 +1,3 @@ { - "*.{ts,tsx}": ["eslint --fix", "prettier --write"] + "*.{ts,tsx}": ["eslint --fix"] } diff --git a/apps/shelter/package.json b/apps/shelter/package.json index 245d34dc..d75db056 100644 --- a/apps/shelter/package.json +++ b/apps/shelter/package.json @@ -29,6 +29,7 @@ "zustand": "^4.4.4" }, "devDependencies": { + "@types/node": "^20.8.10", "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react-swc": "^3.4.0", @@ -42,4 +43,4 @@ "msw": { "workerDirectory": "public" } -} \ No newline at end of file +} diff --git a/apps/shelter/tsconfig.json b/apps/shelter/tsconfig.json index a803037c..196467b5 100644 --- a/apps/shelter/tsconfig.json +++ b/apps/shelter/tsconfig.json @@ -1,4 +1,10 @@ { "extends": "tsconfig/vite.json", - "include": ["src"] + "include": ["src"], + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + } + } } diff --git a/apps/shelter/vite.config.ts b/apps/shelter/vite.config.ts index e1b1b763..027e0107 100644 --- a/apps/shelter/vite.config.ts +++ b/apps/shelter/vite.config.ts @@ -4,4 +4,7 @@ import { defineConfig } from 'vite'; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + resolve: { + alias: [{ find: '@', replacement: '/src' }], + }, }); diff --git a/apps/volunteer/package.json b/apps/volunteer/package.json index b80ba9ab..a13091cf 100644 --- a/apps/volunteer/package.json +++ b/apps/volunteer/package.json @@ -29,6 +29,7 @@ "zustand": "^4.4.4" }, "devDependencies": { + "@types/node": "^20.8.10", "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react-swc": "^3.4.0", diff --git a/apps/volunteer/tsconfig.json b/apps/volunteer/tsconfig.json index a803037c..196467b5 100644 --- a/apps/volunteer/tsconfig.json +++ b/apps/volunteer/tsconfig.json @@ -1,4 +1,10 @@ { "extends": "tsconfig/vite.json", - "include": ["src"] + "include": ["src"], + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + } + } } diff --git a/apps/volunteer/vite.config.ts b/apps/volunteer/vite.config.ts index e1b1b763..027e0107 100644 --- a/apps/volunteer/vite.config.ts +++ b/apps/volunteer/vite.config.ts @@ -4,4 +4,7 @@ import { defineConfig } from 'vite'; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + resolve: { + alias: [{ find: '@', replacement: '/src' }], + }, }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a97d301f..c3342c43 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -96,6 +96,9 @@ importers: specifier: ^4.4.4 version: 4.4.4(@types/react@18.2.15)(react@18.2.0) devDependencies: + '@types/node': + specifier: ^20.8.10 + version: 20.8.10 '@types/react': specifier: ^18.2.15 version: 18.2.15 @@ -122,7 +125,7 @@ importers: version: 5.0.2 vite: specifier: ^4.4.5 - version: 4.4.5(@types/node@18.18.7) + version: 4.4.5(@types/node@20.8.10) apps/volunteer: dependencies: @@ -178,6 +181,9 @@ importers: specifier: ^4.4.4 version: 4.4.4(@types/react@18.2.15)(react@18.2.0) devDependencies: + '@types/node': + specifier: ^20.8.10 + version: 20.8.10 '@types/react': specifier: ^18.2.15 version: 18.2.15 @@ -201,7 +207,7 @@ importers: version: 5.0.2 vite: specifier: ^4.4.5 - version: 4.4.5(@types/node@18.18.7) + version: 4.4.5(@types/node@20.8.10) packages/eslint-config-custom: dependencies: @@ -2358,6 +2364,12 @@ packages: undici-types: 5.26.5 dev: true + /@types/node@20.8.10: + resolution: {integrity: sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w==} + dependencies: + undici-types: 5.26.5 + dev: true + /@types/normalize-package-data@2.4.3: resolution: {integrity: sha512-ehPtgRgaULsFG8x0NeYJvmyH1hmlfsNLujHe9dQEia/7MAJYdzMSi19JtchUHjmBA6XC/75dK55mzZH+RyieSg==} dev: true @@ -2533,7 +2545,7 @@ packages: vite: ^4 dependencies: '@swc/core': 1.3.95 - vite: 4.4.5(@types/node@18.18.7) + vite: 4.4.5(@types/node@20.8.10) transitivePeerDependencies: - '@swc/helpers' dev: true @@ -6620,7 +6632,7 @@ packages: spdx-expression-parse: 3.0.1 dev: true - /vite@4.4.5(@types/node@18.18.7): + /vite@4.4.5(@types/node@20.8.10): resolution: {integrity: sha512-4m5kEtAWHYr0O1Fu7rZp64CfO1PsRGZlD3TAB32UmQlpd7qg15VF7ROqGN5CyqN7HFuwr7ICNM2+fDWRqFEKaA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -6648,7 +6660,7 @@ packages: terser: optional: true dependencies: - '@types/node': 18.18.7 + '@types/node': 20.8.10 esbuild: 0.18.20 postcss: 8.4.31 rollup: 3.29.4