chore(docs): 忽略搜索索引产物并在 dev 启动时生成#131
Merged
Merged
Conversation
- 将自动生成的 search.cn.json / search.en.json 加入 .gitignore, 与 llms.txt 等生成产物保持一致,避免 ~5MB 仓库膨胀及 generatedAt 时间戳造成的无意义 diff - git rm --cached 移除已追踪的两个索引文件(磁盘文件保留) - dev 脚本补充 node ./scripts/gen-search.mjs,确保 clone 后 直接 vp dev 搜索功能不会 404,与 build 行为对齐
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 本次变更属于 ...
🔗 相关 Issue
💡 背景与方案
packages/docs/public/search.cn.json(1.3M)与search.en.json(3.6M)是由scripts/gen-search.mjs从src/pages/**/*.md自动生成的索引产物,并非手写内容。它们此前被纳入 git 追踪,带来两个问题:meta.generatedAt时间戳,每次 build 都会产生无意义变更,污染提交历史。与已忽略的同类生成产物(
llms.txt/llms-full.txt/llms-full-cn.txt/public/**/*.md)保持一致处理方式。方案:
.gitignore;git rm --cached从索引移除(磁盘文件保留,dev/build 时重新生成);dev脚本原本不调用gen-search.mjs,若直接忽略会导致 clone 后首次vp dev搜索框 fetch/search.cn.json404。因此在dev脚本中补充node ./scripts/gen-search.mjs,与build行为对齐。无 UI / 交互变化。
📝 变更日志
devscript to avoid 404.dev脚本中生成以避免 404。