Open2
Astroメモ📝
命名(慣習)
-
page/*.astro
ファイルは kebab-case(URLに反映される) -
src/components/
内のコンポーネント名は PascalCase
パスエイリアスを使う👀
-
tsconfig.json
にパスの設定tsconfig.json{ "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["src/*"] } } }
-
astro.config.mjs
に Vite用 のエイリアスも追加astro.config.mjsimport { defineConfig } from 'astro/config'; export default defineConfig({ vite: { resolve: { alias: { '@': new URL('./src', import.meta.url).pathname, } } } });