feat(frontend): show CPR wordmark and repository link in the browser console

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Zyy
2026-11-21 19:23:03 +08:00
co-authored by Codex
parent a1954c4746
commit d05d38718e
2 changed files with 29 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import type { Plugin } from 'vite'
const banner = `
██████╗ ██████╗ ██████╗
██╔════╝ ██╔══██╗ ██╔══██╗
██║ ██████╔╝ ██████╔╝
██║ ██╔═══╝ ██╔═██╗
╚██████╗ ██║ ██║ ██╗
╚═════╝ ╚═╝ ╚═╝ ╚═╝
https://github.com/zyycn/codex-proxy-rs`
export function consoleBanner(): Plugin {
return {
name: 'cpr-console-banner',
transformIndexHtml: {
order: 'pre',
handler: () => [
{
tag: 'script',
attrs: { type: 'module' },
children: `console.info(${JSON.stringify(banner)})`,
},
],
},
}
}
+2
View File
@@ -4,6 +4,7 @@ import VueI18n from '@intlify/unplugin-vue-i18n/vite'
import tailwindcss from '@tailwindcss/vite'
import vue from '@vitejs/plugin-vue'
import { defineConfig, loadEnv } from 'vite'
import { consoleBanner } from './build/console-banner.ts'
import { pluginBridge } from './build/plugin-bridge.ts'
export default defineConfig(({ mode }) => {
@@ -23,6 +24,7 @@ export default defineConfig(({ mode }) => {
source: sourceUi ? uiRoot : undefined,
}),
pluginBridge(),
consoleBanner(),
],
resolve: {
alias: {