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でのデプロイ記録

Last updated at Posted at 2024-10-14

モノレポ構成のアプリで、フロントエンドをVercelでデプロイしました。
AWSに比べたらめちゃくちゃ簡単でしたが、参考にした記事をまとめておきます。
フロントエンドの開発環境はReact×Viteです。

ハマったところ

開発環境では画像が表示されるのに本番環境では表示されない事象が発生。

vercel.jsonでにimagesへのルーティングに関する記述を追加したところ、無事に表示された。

{
  "routes": [
    {
      "src": "/images/(.*)",
      "dest": "/images/$1"
    },
    {
      "src": "/assets/(.*)",
      "dest": "/assets/$1"
    },
    {
      "src": "/(.*)",
      "dest": "/index.html"
    }
  ]
}

下記の記事はpublicフォルダにimageを保管する方法。

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?