TODOROKI MOTION ブログは以下に移動しました。

3秒後に新しいページへ移動します。
自動的に移動しない場合は、お手数ですが以下をクリックしてください。

ブログ(トドロキモーション公式サイト内)

The TODOROKI MOTION blog has moved to a new location.

he page will redirect in 3 seconds.
If it doesn't, please click the link below.

Blog (on the official TODOROKI MOTION website)

1. @vercel/analytics をインストールする


pnpm i @vercel/analytics

2. astro.config.mjsで webAnalytics を有効化

以下のように astro.config.js の vercel() に、 “webAnanlytics” 項目を追加する。

https://vercel.com/docs/analytics/quickstart#enable-analytics-in-your-astro.config.mjs-file


import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/serverless';
 
export default defineConfig({
  output: 'server',
  adapter: vercel({
    webAnalytics: {
      enabled: true,
    },
  }),
});

この説明では、output が “server” だが、“static” の場合も問題なく動作する。

3. デプロイする


vercel --prod

以上。