feat: update residence learning flows
Commit non-media application and asset changes while leaving audio, video, and environment files out of version control. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
68ba22a33f
commit
6d40e19346
184 files changed
+7663
-2203
No files matched your search
+27
-17
@@ -1,42 +1,52 @@
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import path from "path";
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import path from 'path'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
base: "./",
|
||||
base: './',
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
host: "0.0.0.0",
|
||||
host: '0.0.0.0',
|
||||
// port: 5000,
|
||||
},
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
entryFileNames: 'js/[name]-[hash].js',
|
||||
chunkFileNames: 'js/[name]-[hash].js',
|
||||
assetFileNames: (assetInfo) => {
|
||||
const filename = assetInfo.names[0] ?? assetInfo.originalFileNames[0] ?? ''
|
||||
const ext = path.extname(filename).slice(1).toLowerCase()
|
||||
|
||||
if (ext === 'css') return 'css/[name]-[hash][extname]'
|
||||
if (['png', 'jpg', 'jpeg', 'gif', 'svg', 'webp', 'avif'].includes(ext)) {
|
||||
return 'images/[name]-[hash][extname]'
|
||||
}
|
||||
|
||||
return 'assets/[name]-[hash][extname]'
|
||||
},
|
||||
manualChunks: (id) => {
|
||||
// 将 components/index.ts 和它导出的组件放在同一个 chunk,避免循环依赖
|
||||
if (
|
||||
id.includes("components/index") ||
|
||||
id.includes("components/guide/StudyGuideModal") ||
|
||||
id.includes("components/clue/ClueHintModal") ||
|
||||
id.includes("components/clue/ClueBookModal")
|
||||
id.includes('components/index') ||
|
||||
id.includes('components/guide/StudyGuideModal') ||
|
||||
id.includes('components/clue/ClueHintModal') ||
|
||||
id.includes('components/clue/ClueBookModal')
|
||||
) {
|
||||
return "components-shared";
|
||||
return 'components-shared'
|
||||
}
|
||||
// 将其他 guide 和 clue 组件也放在同一个 chunk
|
||||
if (
|
||||
id.includes("components/guide") ||
|
||||
id.includes("components/clue")
|
||||
) {
|
||||
return "components-shared";
|
||||
if (id.includes('components/guide') || id.includes('components/clue')) {
|
||||
return 'components-shared'
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
})
|
||||
Reference in new issue
Block a user