From 4c5e03598f15f825dfe86e8698c0b17694d1b441 Mon Sep 17 00:00:00 2001
From: p-sw <shinwoo.park@psw.kr>
Date: Sat, 1 Jun 2024 02:20:09 +0900
Subject: [PATCH] feat: add alias for easily importing components in document

---
 packages/react/tsconfig.json  | 10 ++++++++--
 packages/react/vite.config.ts |  6 ++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json
index e16448f..0151b86 100644
--- a/packages/react/tsconfig.json
+++ b/packages/react/tsconfig.json
@@ -18,8 +18,14 @@
     "strict": true,
     "noUnusedLocals": true,
     "noUnusedParameters": true,
-    "noFallthroughCasesInSwitch": true
+    "noFallthroughCasesInSwitch": true,
+
+    /* Path */
+    "baseUrl": "./",
+    "paths": {
+      "@components/*": ["components/*"],
+    }
   },
-  "include": ["components", "stories", "./stories.ts", "src"],
+  "include": ["components", "src"],
   "references": [{ "path": "./tsconfig.node.json" }]
 }
diff --git a/packages/react/vite.config.ts b/packages/react/vite.config.ts
index 18bc786..32eca87 100644
--- a/packages/react/vite.config.ts
+++ b/packages/react/vite.config.ts
@@ -2,6 +2,7 @@ import { defineConfig } from "vite";
 import react from "@vitejs/plugin-react";
 import tailwindcss from "tailwindcss";
 import mdx from '@mdx-js/rollup';
+import { resolve } from 'node:path';
 
 // https://vitejs.dev/config/
 export default defineConfig({
@@ -11,4 +12,9 @@ export default defineConfig({
       plugins: [tailwindcss()],
     },
   },
+  resolve: {
+    alias: {
+      '@components': resolve(__dirname, './components'),
+    }
+  }
 });