mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-13 11:13:43 +08:00
Vite's dep pre-bundling runs esbuild's lite parser over .vue script blocks to find imports. On esbuild 0.27.5 that parser interprets the HTML-style sequence `<!--` inside a JS string/regex literal as the start of a legacy line comment, which made it conflate two unrelated string literals on lines 95 and 110 of MemoryBrowser.vue and report a fake "Unterminated string literal" against a phantom line that doesn't exist in the source. Replacing the raw `<` with `\x3c` keeps the runtime behavior identical (includes/regex match the same `<!-- user-edited` marker) but breaks the HTML-comment heuristic so the scanner no longer chokes. The two call sites — userEdited detection in parseSections and the strip regex in stripMarker — both need the escape. Repro: `pnpm dev` from a cold cache surfaces the error during dep scan, runtime tests passed already because the actual JS parser handles the strings fine. |
||
|---|---|---|
| .. | ||
| public | ||
| src | ||
| test | ||
| .npmrc | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| pnpm-lock.yaml | ||
| TEST_CASES.md | ||
| tsconfig.json | ||
| vite.config.ts | ||
| vitest.config.ts | ||
| yarn.lock | ||