Add social share preview and reduce mobile fighter size

This commit is contained in:
2026-10-15 18:06:50 +09:00
parent d87f5bc1db
commit 3540f392b0
4 changed files with 30 additions and 1 deletions
+26
View File
@@ -1,7 +1,33 @@
import { defineConfig } from 'vite';
import { resolve } from 'node:path';
import { GAME_NAME, GAME_DESCRIPTION, GAME_URL, GAME_SHARE_IMAGE } from './constants/branding.js';
export default defineConfig({
root: 'src/client',
plugins: [{
name: 'game-share-metadata',
transformIndexHtml(_html, context) {
if (context.path !== '/index.html' && context.path !== '/') return [];
return [
{ name: 'description', content: GAME_DESCRIPTION },
{ property: 'og:type', content: 'website' },
{ property: 'og:locale', content: 'ko_KR' },
{ property: 'og:site_name', content: GAME_NAME },
{ property: 'og:title', content: GAME_NAME },
{ property: 'og:description', content: GAME_DESCRIPTION },
{ property: 'og:url', content: GAME_URL },
{ property: 'og:image', content: GAME_SHARE_IMAGE },
{ property: 'og:image:type', content: 'image/png' },
{ property: 'og:image:width', content: '1200' },
{ property: 'og:image:height', content: '630' },
{ property: 'og:image:alt', content: `${GAME_NAME} 타이틀과 세 캐릭터` },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:title', content: GAME_NAME },
{ name: 'twitter:description', content: GAME_DESCRIPTION },
{ name: 'twitter:image', content: GAME_SHARE_IMAGE },
{ name: 'twitter:image:alt', content: `${GAME_NAME} 타이틀과 세 캐릭터` },
].map(attrs => ({ tag: 'meta', attrs, injectTo: 'head' as const }));
},
}],
build: { outDir: '../../dist/client', emptyOutDir: true,
rollupOptions: { input: { game: resolve('src/client/index.html'), admin: resolve('src/client/admin/analytics/index.html') } },
},