0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Vercel Hobby枠で個人プロジェクトを回す実務Tips:TypeScriptとNext.jsの活用

0
Posted at

Vercel Hobby枠で個人プロジェクトを回す実務Tips:TypeScriptとNext.jsの活用

はじめに

Vercelは、Next.jsやCreate React Appなどのフロントエンドフレームワークをサポートしているホスティングサービスです。特に、個人プロジェクトや小規模プロジェクトに適したHobby枠を提供しています。この記事では、Vercel Hobby枠で個人プロジェクトを回す実務Tipsについて、TypeScriptとNext.jsの活用に焦点をあてて紹介します。

TypeScriptの活用

TypeScriptは、JavaScriptの拡張言語であり、静的型付けを提供します。Next.jsプロジェクトでは、TypeScriptを使用することで、コードの品質と保守性を向上させることができます。

// tsconfig.json
{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": false,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve"
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules"]
}

Next.jsの活用

Next.jsは、Reactを基盤とするサーバーサイドレンダリング対応のフレームワークです。Vercelでは、Next.jsプロジェクトを簡単にデプロイすることができます。

// pages/_app.js
import Head from 'next/head';

function MyApp({ Component, pageProps }) {
  return (
    <div>
      <Head>
        <title>My App</title>
      </Head>
      <Component {...pageProps} />
    </div>
  );
}

export default MyApp;

Vercel Hobby枠の設定

Vercel Hobby枠では、以下の設定が可能です。

  • プロジェクトの作成
  • ドメインの設定
  • ビルドとデプロイの設定
# vercel.json
{
  "version": 2,
  "builds": [
    {
      "src": "next.config.js",
      "use": "@vercel/static-build"
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "index.html"
    }
  ]
}

まとめ

この記事では、Vercel Hobby枠で個人プロジェクトを回す実務Tipsについて、TypeScriptとNext.jsの活用に焦点をあてて紹介しました。Vercel Hobby枠を使用することで、個人プロジェクトや小規模プロジェクトを簡単にデプロイすることができます。詳しい手順はこちら → https://felixstudio0.gumroad.com/?utm_source=qiita&utm_medium=github_actions&utm_campaign=2026-q1&utm_content=qiita-footer

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?