From d53aa81df60f0674236d83f933172058ef0aef89 Mon Sep 17 00:00:00 2001 From: hyunaeri Date: Fri, 20 Sep 2024 16:39:36 +0900 Subject: [PATCH] =?UTF-8?q?Env:=20=EC=A0=88=EB=8C=80=EA=B2=BD=EB=A1=9C?= =?UTF-8?q?=EB=A5=BC=20=EC=9D=B8=EC=8B=9D=ED=95=98=EC=A7=80=20=EB=AA=BB?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.tsx | 2 +- tsconfig.app.json | 4 ++-- tsconfig.json | 14 +++++++++++++- tsconfig.node.json | 3 +-- vite.config.ts | 32 ++++++++++++++++++++------------ 5 files changed, 37 insertions(+), 18 deletions(-) diff --git a/src/main.tsx b/src/main.tsx index e77cc40..e8c8c91 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,6 +1,6 @@ import { createRoot } from 'react-dom/client'; -import App from './App.tsx'; +import App from '@/App'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; const queryClient = new QueryClient(); diff --git a/tsconfig.app.json b/tsconfig.app.json index f0a2350..f8293c7 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -1,17 +1,17 @@ { + "extends": "./tsconfig.json", "compilerOptions": { "target": "ES2020", "useDefineForClassFields": true, "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", "skipLibCheck": true, + "composite": true, /* Bundler mode */ "moduleResolution": "bundler", - "allowImportingTsExtensions": true, "isolatedModules": true, "moduleDetection": "force", - "noEmit": true, "jsx": "react-jsx", /* Linting */ diff --git a/tsconfig.json b/tsconfig.json index 0b6f721..ca669a8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,10 +2,22 @@ "compilerOptions": { "baseUrl": ".", "paths": { - "@/*": ["src/*"] + "@/*": ["src/*"], + "@/components/*": ["src/components/*"], + "@/pages/*": ["src/pages/*"], + "@/apis/*": ["src/apis/*"], + "@/hooks/*": ["src/hooks/*"], + "@/store/*": ["src/store/*"], + "@/utils/*": ["src/utils/*"], + "@/assets/*": ["src/assets/*"], + "@/constants/*": ["src/constants/*"], + "@/config/*": ["src/config/*"], + "@/mocks/*": ["src/mocks/*"], + "@/styles/*": ["src/styles/*"] } }, "files": [], + "include": ["src"], "references": [ { "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" } diff --git a/tsconfig.node.json b/tsconfig.node.json index 0d3d714..0b2f531 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -4,13 +4,12 @@ "lib": ["ES2023"], "module": "ESNext", "skipLibCheck": true, + "composite": true, /* Bundler mode */ "moduleResolution": "bundler", - "allowImportingTsExtensions": true, "isolatedModules": true, "moduleDetection": "force", - "noEmit": true, /* Linting */ "strict": true, diff --git a/vite.config.ts b/vite.config.ts index e5a6984..fa52c4e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,17 +6,25 @@ import react from '@vitejs/plugin-react'; export default defineConfig({ plugins: [react()], resolve: { - alias: { - '@/components': path.resolve(__dirname, 'src/components'), - '@/pages': path.resolve(__dirname, 'src/pages'), - '@/apis': path.resolve(__dirname, 'src/apis'), - '@/hooks': path.resolve(__dirname, 'src/hooks'), - '@/store': path.resolve(__dirname, 'src/store'), - '@/utils': path.resolve(__dirname, 'src/utils'), - '@/assets': path.resolve(__dirname, 'src/assets'), - '@/constants': path.resolve(__dirname, 'src/constants'), - '@/config': path.resolve(__dirname, 'src/config'), - '@/styles': path.resolve(__dirname, 'src/styles'), - }, + alias: [ + { find: '@/', replacement: path.resolve(__dirname, 'src') }, + { + find: '@/components', + replacement: path.resolve(__dirname, 'src/components'), + }, + { find: '@/pages', replacement: path.resolve(__dirname, 'src/pages') }, + { find: '@/apis', replacement: path.resolve(__dirname, 'src/apis') }, + { find: '@/hooks', replacement: path.resolve(__dirname, 'src/hooks') }, + { find: '@/store', replacement: path.resolve(__dirname, 'src/store') }, + { find: '@/utils', replacement: path.resolve(__dirname, 'src/utils') }, + { find: '@/assets', replacement: path.resolve(__dirname, 'src/assets') }, + { + find: '@/constants', + replacement: path.resolve(__dirname, 'src/constants'), + }, + { find: '@/config', replacement: path.resolve(__dirname, 'src/config') }, + { find: '@/mocks', replacement: path.resolve(__dirname, 'src/mocks') }, + { find: '@/styles', replacement: path.resolve(__dirname, 'src/styles') }, + ], }, });