src/types/env.d.ts ( ファイル名やディレクトリはどこでもokです )
declare namespace NodeJS {
interface ProcessEnv {
readonly APP_NAME: string;
readonly NEXT_PUBLIC_APP_NAME: string;
readonly DB_CONNECTION: string;
readonly DB_HOST: string;
readonly DB_PORT: string;
readonly DB_DATABASE: string;
readonly DB_USERNAME: string;
readonly DB_PASSWORD: string;
}
}
.env
# APP
APP_NAME=アプリ名
NEXT_PUBLIC_APP_NAME=${APP_NAME}