Skip to content

Fix CommonJS build configs - separate ESM/CJS output directories#155

Merged
devbro1 merged 9 commits intomasterfrom
copilot/fix-cjs-build-configs
Feb 28, 2026
Merged

Fix CommonJS build configs - separate ESM/CJS output directories#155
devbro1 merged 9 commits intomasterfrom
copilot/fix-cjs-build-configs

Conversation

Copy link
Contributor

Copilot AI commented Feb 24, 2026

Description

CJS and ESM builds outputted to the same dist/ directory, causing builds to overwrite each other. Applied the fix from neko-config to all other packages.

Changes per package:

  • tsup.config.ts

    • Added outDir: 'dist/esm' for ESM builds
    • Added outDir: 'dist/cjs' for CJS builds
    • Enabled dts: true for CJS builds
  • package.json

    • Updated paths: dist/index.jsdist/cjs/index.js, dist/index.mjsdist/esm/index.mjs
    • For neko-http/neko-mailer: Removed CJS paths from sub-exports (CJS is bundled, only index.js exists)
    • For neko-sql: Fixed incorrect index.cjs reference to index.js

Affected packages: neko-cache, neko-context, neko-helper, neko-http, neko-logger, neko-mailer, neko-orm, neko-queue, neko-router, neko-scheduler, neko-sql, neko-storage

Result: ESM and CJS builds now output to separate directories without conflicts.

Checklist

  • lint/prettier
  • updated docs with new feature/details
  • added tests that cover changes
  • Add jsdocs for any added function/class

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • undefined
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node --conditions node --conditions development /home/REDACTED/work/pashmak/pashmak/node_modules/tinypool/dist/entry/process.js l/openssl/includ./Release/.deps/Release/obj.target/test_extension/deps/ ndor/bin/git e --global /usr/local/bin/g--noprofile yarn buil�� celain --ignore-submodules | head -n 10 c0ad1c11 k/pashmak/pashmak/neko-http/node_modules/.bin/tsup e --global on3 /bin/sh (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>fix commonjs build configs</issue_title>
<issue_description>cjs build is broken. it is fixed in neko-config, and changes are needed for other packages to fix this.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 24, 2026 04:07
Co-authored-by: devbro1 <29712935+devbro1@users.noreply.github.com>
Co-authored-by: devbro1 <29712935+devbro1@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CommonJS build configurations Fix CommonJS build configs - separate ESM/CJS output directories Feb 24, 2026
@devbro1 devbro1 marked this pull request as ready for review February 28, 2026 01:43
@devbro1 devbro1 merged commit 0053df1 into master Feb 28, 2026
0 of 2 checks passed
@devbro1 devbro1 deleted the copilot/fix-cjs-build-configs branch February 28, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix commonjs build configs

2 participants