.swcrc
490 Bytes
-
fix(build): .swcrc 的 exclude 是正则,必须锚定 · eb4d01c6
跟刚 revert 的 hover 改动无关,单独留下 —— 这是个静默的构建坑,任何人加文件都可能撞上。 原写 ["node_modules", "dist"],看着像目录名,swc 实际当**正则**匹配整个文件路径。 于是文件名里含 "dist" 的源文件被直接跳过:271 个源文件只编译出 270 个,swc 不报错 (照样打印 "Successfully compiled: 270 files"),直到进程启动才 MODULE_NOT_FOUND。 同类地雷:distinct / distance / district / redistribute… 更难查的是两边表现不一致 —— 只在 swc 路径(dev / --builder swc)复现, nest build 走 tsc 一切正常。 锚定成 ["^node_modules/", "^dist/"],并加断言:exclude 必须以 ^ 开头, 且遍历 src 下全部 .ts 确认一个都没被误伤。 456 tests green。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
luoqi committed