feat: add alias for easily importing components in document

This commit is contained in:
p-sw 2024-06-01 02:20:09 +09:00
parent 7ac2a62f3b
commit 4c5e03598f
2 changed files with 14 additions and 2 deletions

View File

@ -18,8 +18,14 @@
"strict": true, "strict": true,
"noUnusedLocals": true, "noUnusedLocals": true,
"noUnusedParameters": 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" }] "references": [{ "path": "./tsconfig.node.json" }]
} }

View File

@ -2,6 +2,7 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
import tailwindcss from "tailwindcss"; import tailwindcss from "tailwindcss";
import mdx from '@mdx-js/rollup'; import mdx from '@mdx-js/rollup';
import { resolve } from 'node:path';
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
@ -11,4 +12,9 @@ export default defineConfig({
plugins: [tailwindcss()], plugins: [tailwindcss()],
}, },
}, },
resolve: {
alias: {
'@components': resolve(__dirname, './components'),
}
}
}); });