Skip to content

Stop bundling: ship dist/ as one file per module #118

Done

Description

@Shinrai

The build bundles src/ into one dist/index.mjs with tsup. Under the fleet rule in CLDMV/.github#582, builds no longer bundle: they don't move code around, merge modules into one file, or duplicate code to fit a bundler.

What to change:

  • dist/ mirrors src/, one file per module, each minified in place with keepNames.
  • No tsup bundle, no splitting, no chunk-* files.
  • Check every new URL("./x", import.meta.url) and relative path for the new layout.
  • Keep the hand-written src/index.cjs shim as it is.

Reference: CLDMV/lib-sqlite-wasm scripts/build-js.mjs. Plain .mjs repos can use esbuild with bundle: false over src/**/*.mjs, as droidsock, git-embedded, jsonv and llm-translator already do through tsup's bundle: false.

Activity

  1. added
    type: enhancement
    priority: medium
    status: not started
    on Nov 26, 2026
  2. Shinrai commented on Nov 27, 2026

    @Shinrai
    ContributorAuthor

    v4.46.0 also shipped the generic index.cjs (CLDMV/.github#589, examples/package-layout/src/index.cjs): require() returns the single exported value when the ESM entry has one distinct value, otherwise the module object import gives. This package exports createRemote and createAndroidTVRemote, so adopting it changes what require() returns — require(pkg)(…) callers need require(pkg).default or the named export. Roll it into the same major as the build change here.

  3. added a commit that references this issue on Nov 28, 2026
    baa5904
  4. added
    status: implemented
    and removed
    status: not started
    on Nov 28, 2026
  5. cldmv-bot commented on Nov 28, 2026

    @cldmv-bot
    Contributor

    Marked status: implemented — resolved by #124, merged into next. This issue closes automatically when that work ships to the default branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumstatus: implementedtype: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions