feat: update codex live chat workflow
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { cpSync, existsSync, mkdirSync, readdirSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
import { join, resolve } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { defineConfig, type ResolvedConfig, type ViteDevServer } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { VitePWA } from 'vite-plugin-pwa';
|
||||
@@ -19,6 +20,8 @@ const VITE_PUBLIC_HMR_CLIENT_PORT = Number(processEnv.VITE_PUBLIC_HMR_CLIENT_POR
|
||||
const VITE_EMPTY_OUT_DIR = processEnv.VITE_EMPTY_OUT_DIR !== 'false';
|
||||
const VITE_FILTER_PUBLIC_DIR = processEnv.VITE_FILTER_PUBLIC_DIR === 'true';
|
||||
const VITE_DISABLE_MODULE_PRELOAD = processEnv.VITE_DISABLE_MODULE_PRELOAD === 'true';
|
||||
const VITE_DISABLE_PWA = processEnv.VITE_DISABLE_PWA === 'true';
|
||||
const ROOT_DIR = fileURLToPath(new URL('.', import.meta.url));
|
||||
|
||||
function shouldIgnoreDevUpdatePath(watchedPath: string) {
|
||||
return (
|
||||
@@ -121,6 +124,13 @@ function copyPublicAssetsExceptCodexChat() {
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
resolve: {
|
||||
alias: VITE_DISABLE_PWA
|
||||
? {
|
||||
'virtual:pwa-register': resolve(ROOT_DIR, 'src/app/main/pwaRegisterStub.ts'),
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
build: {
|
||||
copyPublicDir: !VITE_FILTER_PUBLIC_DIR,
|
||||
emptyOutDir: VITE_EMPTY_OUT_DIR,
|
||||
@@ -163,44 +173,48 @@ export default defineConfig({
|
||||
react(),
|
||||
createDevAppUpdatePlugin(),
|
||||
copyPublicAssetsExceptCodexChat(),
|
||||
VitePWA({
|
||||
strategies: 'injectManifest',
|
||||
srcDir: 'src',
|
||||
filename: 'sw.js',
|
||||
registerType: 'prompt',
|
||||
includeAssets: ['favicon.svg', 'apple-touch-icon.svg'],
|
||||
injectManifest: {
|
||||
globPatterns: ['**/*.{js,css,html,ico,png,svg,webp,woff2}'],
|
||||
globIgnores: ['**/.codex_chat/**'],
|
||||
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
|
||||
},
|
||||
manifest: {
|
||||
name: 'AI Code App',
|
||||
short_name: 'AI Code App',
|
||||
description: 'Ant Design 기반 UI 샘플과 문서를 확인하는 AI Code App',
|
||||
theme_color: '#165dff',
|
||||
background_color: '#eff5ff',
|
||||
display: 'standalone',
|
||||
lang: 'ko',
|
||||
scope: '/',
|
||||
start_url: '/',
|
||||
icons: [
|
||||
{
|
||||
src: '/pwa-192x192.svg',
|
||||
sizes: '192x192',
|
||||
type: 'image/svg+xml',
|
||||
},
|
||||
{
|
||||
src: '/pwa-512x512.svg',
|
||||
sizes: '512x512',
|
||||
type: 'image/svg+xml',
|
||||
purpose: 'any maskable',
|
||||
},
|
||||
],
|
||||
},
|
||||
devOptions: {
|
||||
enabled: true,
|
||||
},
|
||||
}),
|
||||
],
|
||||
!VITE_DISABLE_PWA &&
|
||||
VitePWA({
|
||||
strategies: 'injectManifest',
|
||||
srcDir: 'src',
|
||||
filename: 'sw.js',
|
||||
registerType: 'prompt',
|
||||
includeAssets: ['favicon.svg', 'apple-touch-icon.svg'],
|
||||
workbox: {
|
||||
maximumFileSizeToCacheInBytes: 8 * 1024 * 1024,
|
||||
},
|
||||
injectManifest: {
|
||||
globPatterns: ['**/*.{js,css,html,ico,png,svg,webp,woff2}'],
|
||||
globIgnores: ['**/.codex_chat/**'],
|
||||
maximumFileSizeToCacheInBytes: 8 * 1024 * 1024,
|
||||
},
|
||||
manifest: {
|
||||
name: 'AI Code App',
|
||||
short_name: 'AI Code App',
|
||||
description: 'Ant Design 기반 UI 샘플과 문서를 확인하는 AI Code App',
|
||||
theme_color: '#165dff',
|
||||
background_color: '#eff5ff',
|
||||
display: 'standalone',
|
||||
lang: 'ko',
|
||||
scope: '/',
|
||||
start_url: '/',
|
||||
icons: [
|
||||
{
|
||||
src: '/pwa-192x192.svg',
|
||||
sizes: '192x192',
|
||||
type: 'image/svg+xml',
|
||||
},
|
||||
{
|
||||
src: '/pwa-512x512.svg',
|
||||
sizes: '512x512',
|
||||
type: 'image/svg+xml',
|
||||
purpose: 'any maskable',
|
||||
},
|
||||
],
|
||||
},
|
||||
devOptions: {
|
||||
enabled: true,
|
||||
},
|
||||
}),
|
||||
].filter(Boolean),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user