- 更新 ESLint 配置以忽略 vite.config.ts 文件。 - 在 package.json 中添加 pnpm 配置。 - 修改 tsconfig 文件以包含 vite.config.ts 和 eslint.config.ts。 - 在多个场景中添加引导对话,增强用户学习体验。 - 更新组件中的文本和描述,确保一致性和准确性。
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import path from "path";
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
base: "./",
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
server: {
|
|
host: "0.0.0.0",
|
|
// port: 5000,
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
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")
|
|
) {
|
|
return "components-shared";
|
|
}
|
|
// 将其他 guide 和 clue 组件也放在同一个 chunk
|
|
if (
|
|
id.includes("components/guide") ||
|
|
id.includes("components/clue")
|
|
) {
|
|
return "components-shared";
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|