Loading...
Loading...
Compare original and translation side by side
cloudcannon devcloudcannon devcloudcannon dev--app-synccloudcannon dev--app-synccloudcannon configure detect-build-commands # build command and output directory
<build the site> # see The build command, below
cloudcannon dev <output-dir> --port 10101 # leave runninghttp://localhost:10101| They do this | This happens |
|---|---|
| Change a source file in the editor | It reaches disk. Rebuild, then the preview updates itself |
| Change a source file on disk | Same — the server syncs it into the app. Rebuild, same result |
| Route | What they do | Costs |
|---|---|---|
| Manual | Re-run the build after a batch of edits | Nothing. Rebuild when they want a fresh preview |
| Watched | Run watch-build.mjs | A full build per change |
cloudcannon configure detect-build-commands # build command and output directory
<build the site> # see The build command, below
cloudcannon dev <output-dir> --port 10101 # leave runninghttp://localhost:10101| 用户执行此操作 | 发生的情况 |
|---|---|
| 在编辑器中更改源文件 | 文件会同步到磁盘。重新构建后,预览会自动更新 |
| 在磁盘上更改源文件 | 同样如此——服务器会将更改同步到应用中。重新构建后,结果相同 |
| 方式 | 用户需要做什么 | 成本 |
|---|---|---|
| 手动 | 完成一批编辑后重新运行构建 | 无额外成本。用户需要时重新构建即可获得最新预览 |
| 监听式 | 运行 watch-build.mjs | 每次更改都会执行一次完整构建 |
cloudcannon configure detect-build-commandsnpm run buildcloudcannon configure detect-build-commandsnpm run buildcloudcannon-configurationcloudcannon-visual-editinginclude_developer_filescloudcannon-configurationcloudcannon-visual-editinginclude_developer_files| File | Covers |
|---|---|
| setup.md | Prerequisites, what |
| dev-server-api.md | The |
| troubleshooting.md | Symptom → cause → fix |
| scripts/README.md | |
| 文件 | 涵盖内容 |
|---|---|
| setup.md | 前置条件、 |
| dev-server-api.md | |
| troubleshooting.md | 症状 → 原因 → 修复方法 |
| scripts/README.md | |
| Excuse | Reality |
|---|---|
" | It serves a directory and nothing else. Until something rebuilds, the preview is whatever was built last. |
| "The editor saved but the page did not change." | Expected. Rebuild — and with a watcher, wait for the build to finish. |
"I will open | |
" | The server has no directory index. Request |
| "Port 10101 answers, so my site is up." | It proves a dev server is there, not that it is yours. Serve on a port you chose and know is free. |
| "The diff is huge, something corrupted it." | CloudCannon reserialises the whole frontmatter on save. Diff the field you changed. |
| 误解 | 实际情况 |
|---|---|
“ | 它只会提供目录内容,不会执行其他操作。在重新构建之前,预览始终是上一次构建的结果。 |
| “编辑器已经保存,但页面没有变化。” | 这是预期现象。请重新构建——使用 watcher 时,还要等待构建完成。 |
“我会打开 | |
“ | 服务器没有目录索引。请请求 |
| “端口 10101 有响应,所以我的站点已经启动。” | 这只能证明存在一个开发服务器,不能证明它属于你。请选择一个明确且确认空闲的端口。 |
| “差异非常大,一定是内容损坏了。” | CloudCannon 在保存时会重新序列化整个 frontmatter。请只对比你更改的字段。 |