[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"blog-en-monorepo-threshold-small-saas":3},{"id":4,"title":5,"author":6,"body":7,"cover":508,"description":509,"draft":510,"extension":511,"locale":512,"meta":513,"navigation":514,"path":515,"publishedAt":516,"seo":517,"seoTitle":518,"slug":519,"stem":520,"tags":521,"__hash__":523},"blog\u002Fen\u002Fblog\u002Fmonorepo-threshold-small-saas.md","Monorepos for a small SaaS: when they pay off and what to skip","Manuel Tardivo",{"type":8,"value":9,"toc":497},"minimark",[10,28,45,50,90,94,121,125,128,147,157,164,181,343,363,374,378,381,412,415,419,447,451,454,469,482,486,493],[11,12,13,14,18,19,23,24,27],"p",{},"A monorepo (pnpm ",[15,16,17],"code",{},"workspace:*",", optionally Turborepo on top) centralizes tooling pins. For ",[20,21,22],"strong",{},"one"," SaaS with 1–3 deployables it can still be ",[20,25,26],{},"overkill"," if you split packages before the boundaries are real.",[11,29,30,31,38,39,44],{},"Technical refs: ",[32,33,37],"a",{"href":34,"rel":35},"https:\u002F\u002Fpnpm.io\u002Fworkspaces",[36],"nofollow","pnpm workspaces",", ",[32,40,43],{"href":41,"rel":42},"https:\u002F\u002Fturbo.build\u002Frepo\u002Fdocs\u002Fcore-concepts\u002Fcaching",[36],"Turborepo caching",".",[46,47,49],"h2",{"id":48},"when-it-actually-helps","When it actually helps",[51,52,53,73,83],"ul",{},[54,55,56,57,60,61,64,65,68,69,72],"li",{},"You ship ",[20,58,59],{},"multiple artifacts"," (",[15,62,63],{},"api"," + ",[15,66,67],{},"web",") that share ",[20,70,71],{},"TS types",", Zod schemas, or generated clients.",[54,74,75,78,79,82],{},[20,76,77],{},"CI"," burns minutes on duplicate installs \u002F non-cached builds—remote cache or ",[15,80,81],{},"turbo run"," pays off.",[54,84,85,86,89],{},"You must ",[20,87,88],{},"coordinate breaking API changes"," with consumers in one revision.",[46,91,93],{"id":92},"skip-on-day-one","Skip on day one",[51,95,96,106,112],{},[54,97,98,101,102,105],{},[20,99,100],{},"Empty packages"," (“future-proof” ",[15,103,104],{},"@acme\u002Ftypes"," with no consumers).",[54,107,108,111],{},[20,109,110],{},"Turbo pipelines"," fanning lint across unrelated folders with near-zero cache hits.",[54,113,114,117,118,120],{},[20,115,116],{},"Independent semver"," for internal libs if you always deploy one atomic release—prefer ",[15,119,17],{}," + git tags.",[46,122,124],{"id":123},"turbo-cache-roi","Turbo cache ROI",[11,126,127],{},"Remote cache wins when:",[51,129,130,137],{},[54,131,132,133,136],{},"Tasks are ",[20,134,135],{},"deterministic"," (same inputs → same outputs).",[54,138,139,142,143,146],{},[15,140,141],{},"outputs"," in ",[15,144,145],{},"turbo.json"," are accurate—otherwise you get poisonous hits.",[11,148,149,150,156],{},"For 1–2 dev teams, sometimes ",[20,151,152,155],{},[15,153,154],{},"pnpm --filter web build"," + CI artifact cache"," is enough without Turbo.",[46,158,160,161,163],{"id":159},"minimal-turbojson-commented","Minimal ",[15,162,145],{}," (commented)",[11,165,166,167,169,170,172,173,176,177,180],{},"Reasonable starting point for two packages ",[15,168,67],{}," and ",[15,171,63],{}," that emit ",[15,174,175],{},"dist"," (rename to match your ",[15,178,179],{},"package.json"," names):",[182,183,188],"pre",{"className":184,"code":185,"language":186,"meta":187,"style":187},"language-json shiki shiki-themes github-light github-dark","{\n  \"$schema\": \"https:\u002F\u002Fturbo.build\u002Fschema.json\",\n  \"tasks\": {\n    \"build\": {\n      \"dependsOn\": [\"^build\"],\n      \"outputs\": [\"dist\u002F**\", \".output\u002F**\"]\n    },\n    \"lint\": {\n      \"outputs\": []\n    },\n    \"test\": {\n      \"dependsOn\": [\"^build\"],\n      \"outputs\": [\"coverage\u002F**\"]\n    }\n  }\n}\n","json","",[15,189,190,199,216,225,233,248,267,273,281,289,294,302,313,325,331,337],{"__ignoreMap":187},[191,192,195],"span",{"class":193,"line":194},"line",1,[191,196,198],{"class":197},"sVt8B","{\n",[191,200,202,206,209,213],{"class":193,"line":201},2,[191,203,205],{"class":204},"sj4cs","  \"$schema\"",[191,207,208],{"class":197},": ",[191,210,212],{"class":211},"sZZnC","\"https:\u002F\u002Fturbo.build\u002Fschema.json\"",[191,214,215],{"class":197},",\n",[191,217,219,222],{"class":193,"line":218},3,[191,220,221],{"class":204},"  \"tasks\"",[191,223,224],{"class":197},": {\n",[191,226,228,231],{"class":193,"line":227},4,[191,229,230],{"class":204},"    \"build\"",[191,232,224],{"class":197},[191,234,236,239,242,245],{"class":193,"line":235},5,[191,237,238],{"class":204},"      \"dependsOn\"",[191,240,241],{"class":197},": [",[191,243,244],{"class":211},"\"^build\"",[191,246,247],{"class":197},"],\n",[191,249,251,254,256,259,261,264],{"class":193,"line":250},6,[191,252,253],{"class":204},"      \"outputs\"",[191,255,241],{"class":197},[191,257,258],{"class":211},"\"dist\u002F**\"",[191,260,38],{"class":197},[191,262,263],{"class":211},"\".output\u002F**\"",[191,265,266],{"class":197},"]\n",[191,268,270],{"class":193,"line":269},7,[191,271,272],{"class":197},"    },\n",[191,274,276,279],{"class":193,"line":275},8,[191,277,278],{"class":204},"    \"lint\"",[191,280,224],{"class":197},[191,282,284,286],{"class":193,"line":283},9,[191,285,253],{"class":204},[191,287,288],{"class":197},": []\n",[191,290,292],{"class":193,"line":291},10,[191,293,272],{"class":197},[191,295,297,300],{"class":193,"line":296},11,[191,298,299],{"class":204},"    \"test\"",[191,301,224],{"class":197},[191,303,305,307,309,311],{"class":193,"line":304},12,[191,306,238],{"class":204},[191,308,241],{"class":197},[191,310,244],{"class":211},[191,312,247],{"class":197},[191,314,316,318,320,323],{"class":193,"line":315},13,[191,317,253],{"class":204},[191,319,241],{"class":197},[191,321,322],{"class":211},"\"coverage\u002F**\"",[191,324,266],{"class":197},[191,326,328],{"class":193,"line":327},14,[191,329,330],{"class":197},"    }\n",[191,332,334],{"class":193,"line":333},15,[191,335,336],{"class":197},"  }\n",[191,338,340],{"class":193,"line":339},16,[191,341,342],{"class":197},"}\n",[51,344,345,356],{},[54,346,347,355],{},[20,348,349,208,352],{},[15,350,351],{},"dependsOn",[15,353,354],{},"[\"^build\"]"," — build upstream workspace deps first (shared types, etc.).",[54,357,358,362],{},[20,359,360],{},[15,361,141],{}," — honest list of generated dirs; if wrong, remote cache silently restores stale artifacts.",[11,364,365,366,369,370,373],{},"Typical local run: ",[15,367,368],{},"pnpm turbo run build --filter=web"," or ",[15,371,372],{},"turbo run build"," from the root when every package should participate.",[46,375,377],{"id":376},"minimal-ci","Minimal CI",[11,379,380],{},"Typical matrix:",[382,383,384,389,398],"ol",{},[54,385,386],{},[15,387,388],{},"pnpm install --frozen-lockfile",[54,390,391,64,394,397],{},[15,392,393],{},"pnpm lint",[15,395,396],{},"pnpm test"," (parallel friendly)",[54,399,400,403,404,407,408,411],{},[15,401,402],{},"pnpm build"," optionally scoped via ",[15,405,406],{},"--filter"," to changed packages (",[15,409,410],{},"git diff"," scripts)",[11,413,414],{},"Avoid duplicating identical jobs per micro-package when total build time stays under a few minutes.",[46,416,418],{"id":417},"remote-caching-and-turbo","Remote caching and Turbo",[11,420,421,422,425,426,433,434,437,438,142,440,442,443,446],{},"If you adopt ",[20,423,424],{},"Turborepo",", the inflection point is usually ",[32,427,430],{"href":428,"rel":429},"https:\u002F\u002Fturbo.build\u002Frepo\u002Fdocs\u002Fcore-concepts\u002Fremote-caching",[36],[20,431,432],{},"remote caching",": reuse ",[15,435,436],{},"dist\u002F"," artifacts and task outputs across CI machines instead of rebuilding cold every time. Without remote cache, Turbo is still a solid local orchestrator but barely moves CI minutes. Declare ",[15,439,141],{},[15,441,145],{}," ",[20,444,445],{},"honestly","—lying to the cache poisons builds silently.",[46,448,450],{"id":449},"when-to-stay-monolithic","When to stay monolithic",[11,452,453],{},"Signals:",[51,455,456,463],{},[54,457,458,459,462],{},"You spend more time ",[20,460,461],{},"bumping internal versions"," than shipping features.",[54,464,465,468],{},[20,466,467],{},"Cross-package debugging"," hurts more than the structural win.",[11,470,471,472,60,475,38,478,481],{},"A tidy ",[20,473,474],{},"monolith with folders",[15,476,477],{},"apps\u002Fweb",[15,479,480],{},"services\u002Fapi",") and one or two package roots is perfectly professional until deploy boundaries diverge.",[46,483,485],{"id":484},"summary","Summary",[11,487,488,489,492],{},"Adopt the monorepo when ",[20,490,491],{},"deploy boundaries + real shared code"," exist. Otherwise keep a disciplined monolith—less tooling, same rigor.",[494,495,496],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":187,"searchDepth":201,"depth":201,"links":498},[499,500,501,502,504,505,506,507],{"id":48,"depth":201,"text":49},{"id":92,"depth":201,"text":93},{"id":123,"depth":201,"text":124},{"id":159,"depth":201,"text":503},"Minimal turbo.json (commented)",{"id":376,"depth":201,"text":377},{"id":417,"depth":201,"text":418},{"id":449,"depth":201,"text":450},{"id":484,"depth":201,"text":485},"\u002Fblog\u002F27_monorepo_threshold_small_saas_1x.webp","When a pnpm workspace (and optional Turborepo) pays off for a single product team, and what not to configure on day one of a small SaaS.",false,"md","en",{},true,"\u002Fen\u002Fblog\u002Fmonorepo-threshold-small-saas","2026-05-29",{"title":5,"description":509},"Monorepos for a small SaaS: the threshold","monorepo-threshold-small-saas","en\u002Fblog\u002Fmonorepo-threshold-small-saas",[522],"mvp","tiacleI1SzBEb8ABlwxcTthXYUMyxLmxfZOyajmWq3Q"]