feat: publish CodexPi contest snapshot
Some checks are pending
Qualité / tests (push) Waiting to run
Some checks are pending
Qualité / tests (push) Waiting to run
This commit is contained in:
25
frontend/vite.config.ts
Normal file
25
frontend/vite.config.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { defineConfig, type Plugin } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
const buildId = `${Date.now()}`
|
||||
const versionAsset = ():Plugin => ({
|
||||
name: 'codexpi-version-asset',
|
||||
generateBundle(){this.emitFile({type:'asset',fileName:'version.json',source:JSON.stringify({build:buildId})})},
|
||||
})
|
||||
|
||||
export default defineConfig({
|
||||
define: {'__CODEXPI_BUILD_ID__': JSON.stringify(buildId)},
|
||||
plugins: [react(),versionAsset()],
|
||||
server: { host: '127.0.0.1', port: 5173, proxy: { '/api': 'http://127.0.0.1:8765', '/ws': { target: 'ws://127.0.0.1:8765', ws: true } } },
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks(id) {
|
||||
if (['react-markdown', 'remark-gfm', 'rehype-highlight', 'highlight.js'].some(name => id.includes(`/node_modules/${name}/`))) return 'markdown'
|
||||
if (['@xterm/xterm', '@xterm/addon-fit'].some(name => id.includes(`/node_modules/${name}/`))) return 'terminal'
|
||||
if (['react', 'react-dom'].some(name => id.includes(`/node_modules/${name}/`))) return 'react'
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user