加入import別名讓import更好看

加入import別名讓import更好看

August 26, 2023

設定

  • tsconfig.json
{
	"compilerOptions": {
	...
	"baseUrl": ".",
	"paths": {
		"@/components/*": ["src/components/*"],
	...
	}
}
  • 使用
import Profile from "@/components/partial/Profile";

ref