Skip to content

Ship packages in multiple formats (CJS and ES) #20

Closed as not planned
Closed as not planned

Description

@driimus

Options by bundle size:

  1. both packages as esm (w/ tree-shaking)
  2. cjs @driimus/lambda-batch-processor, cjs+esm for @driimus/sqs-permanent-failure-dlq
  3. cjs+esm for both

Activity

  1. driimus commented on Dec 5, 2022

    @driimus
    OwnerAuthor

    Might close this as won't do because:

    1. I'd rather exclusively publish all constituent packages as pure ES modules
    2. There's no straightforward way of building to multiple targets
      • tsup bundles the transpiled source code into one file per format (unless you start using custom outDir options for esbuild / provide glob-pattern entry points)
      • unbuild seems bugged in that it performs checks on declaration files on node_modules regardless of skipLibCheck
      • separate configs (tsconfig.esm.json, tsconfig.cjs.json and tsconfig.types.json) work, but compiling 3 times and maintaining so much configuration would be unfeasible given how little upside there is
  2. pinned this issue on Dec 10, 2022
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions