Skip to content

How to Serve Dist and Src to Clients

Wesley B edited this page Feb 20, 2024 · 4 revisions

Summary

How to serve built stylesheets and source code to different clients?

Options

A. ❌ Separate Repo

high maintenance, thus high barrier to entry

  1. npm install the source repo
    • ⓧ extra steps to test on client using just dist
  2. fork the source repo
    • ⓧ extra steps to test on client using just dist
    • ☞ minimal diff
    • ☞ un-.gitignore the dist

B. ❌ Separate Package

high maintenance, premature overhead

  1. separate repo
    • ⓧ see above
  2. protected branches
    • ⓧ unintuitive maintenance
    • ☞ minimal diff
    • ☞ un-.gitignore the dist
  3. monorepo
    • ⓧ nx, npm workspaces, lerna, etc.

C. ✅ Separate Directory

low barrier to entry

  1. commit both /src and /dist
    • ⓧ must suffer noisy diffs
    • ✓ easy to do and understand
    • ✓ easy to replace with future solution