build: switch ogpeek from tsc to tsdown#12
Conversation
빌드 시간을 ~수 초에서 약 800ms로 단축. 산출물은 기존과 동일하게
dist/{index,fetch}.{js,d.ts} 형태로 유지된다.
- tsdown.config.ts 신설: 두 엔트리(.,/fetch), ESM 단일 포맷, dts/sourcemap on
- fixedExtension: false 로 .js / .d.ts 확장자 유지 → exports 매핑 그대로
- htmlparser2 는 dependencies 항목이라 tsdown 기본 동작상 external 유지
- typecheck 는 여전히 tsc --noEmit 으로 분리 (tsdown 은 oxc 기반이라
타입 검사를 하지 않음)
- rimraf 는 tsdown 내장 clean 으로 대체되어 제거
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ogpeek | e82cb50 | Commit Preview URL Branch Preview URL |
Apr 26 2026, 12:19 AM |
There was a problem hiding this comment.
Pull request overview
packages/ogpeek의 빌드 파이프라인을 tsc 기반에서 tsdown(Rolldown + oxc) 기반으로 전환해, dist/{index,fetch}.{js,d.ts} 산출물을 유지하면서 빌드 시간을 단축하려는 PR입니다.
Changes:
packages/ogpeek의 빌드 스크립트를tsdown으로 변경하고rimraf를 제거tsdown.config.ts를 추가해 entry 2개(index,fetch) / ESM / dts / sourcemap / clean 옵션을 설정pnpm-lock.yaml에tsdown및 하위 의존성을 반영
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pnpm-lock.yaml | tsdown 도입에 따른 신규 의존성(rolldown, dts 플러그인 등) lock 반영 및 rimraf 제거 |
| packages/ogpeek/tsdown.config.ts | ogpeek 번들링/타입 산출을 위한 tsdown 설정 파일 신설 |
| packages/ogpeek/package.json | build를 tsdown으로 전환하고 devDependencies 갱신 |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
packages/ogpeek/package.json:55
buildno longer runs TypeScript typechecking (it just bundles). Any downstream scripts that relied onpnpm -F ogpeek buildto fail on type errors (e.g.website'stypecheckwhich callsogpeek build) will stop catching ogpeek type regressions. Consider either (a) updating those callers to runogpeek typecheckexplicitly, or (b) makingbuildruntypecheckand introducing a separatebundle/build:fastscript for tsdown-only bundling.
"build": "tsdown",
"prepack": "pnpm run build",
"test": "vitest run",
"test:watch": "vitest",
"typecheck": "tsc --noEmit"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "scripts": { | ||
| "build": "rimraf dist && tsc -p .", | ||
| "build": "tsdown", | ||
| "prepack": "pnpm run build", |
There was a problem hiding this comment.
prepack currently runs only build, but build no longer typechecks. That means pnpm pack/pnpm publish could produce tarballs even when there are TypeScript errors. Suggest including typecheck in prepack (or adding a dedicated prepack/release script that runs typecheck + tests + build).
| "prepack": "pnpm run build", | |
| "prepack": "pnpm run typecheck && pnpm run test && pnpm run build", |
build에 tsc --noEmit을 선행시켜 website의 build 체인과 npm prepack 경로 양쪽에서 ogpeek 타입 회귀를 다시 잡도록 복구한다. https://claude.ai/code/session_01Y9ikfab6CoTdXf9i64Fe61
Summary
Switches
packages/ogpeek's build tool fromtsctotsdown(Rolldown + oxc). The engine is small (one dependency) with two entry points (.,./fetch), so the transition cost is low and the speed gain is clear.dist/{index,fetch}.{js,d.ts}plus sourcemaps —exportsmapping unchangedChanges
packages/ogpeek/package.jsonbuild: "pnpm run typecheck && tsdown", addtsdown ^0.21.10, droprimrafpackages/ogpeek/tsdown.config.tsfixedExtension: falsepnpm-lock.yamltsdown.config.ts
htmlparser2lives independencies, so tsdown keeps it external by default — no explicit external config needed (v0.21 deprecatedexternalin favor ofdeps.neverBundle).Trade-off
tsdown does not typecheck (oxc-based transpile). To preserve the prior safety where
buildfailed on type errors,buildnow chainstsc --noEmit && tsdown. Type regressions still fail the build exactly as before; the only new surface is a separatetypecheckscript for callers that want the check without bundling.Test plan
pnpm -F ogpeek build— verifydist/outputs (index.js,fetch.js,*.d.ts,*.js.map)pnpm -F ogpeek test— 33/33 passpnpm -F ogpeek typecheck— passpnpm -F website typecheck— pass (chains ogpeek build)dist/index.jsdoes not bundlehtmlparser2(external preserved)dist/index.jshas no Node-only leakage fromfetch.ts(CLAUDE.md principle 1)npm pack --dry-runtarball layout matches the previous outputhttps://claude.ai/code/session_01Y9ikfab6CoTdXf9i64Fe61
Generated by Claude Code