Skip to content

Instantly share code, notes, and snippets.

@lemanschik
Created December 8, 2025 05:11
Show Gist options
  • Select an option

  • Save lemanschik/18c7d75b0cdacaf6036770e04a77b34e to your computer and use it in GitHub Desktop.

Select an option

Save lemanschik/18c7d75b0cdacaf6036770e04a77b34e to your computer and use it in GitHub Desktop.
How to do ECMAScript Packaging in 2026

Publishing

if you got a Typescript Project publish it over github developers will prefer it over the npm package because packaging already packaged eg isomorphic packages is a hell.

Ship a build script for your dependencys to bundle them with your script this allows other developers to integrate your pre existing bundling config.

You expect developers to install via npm? Then publish ESM only js + d.ts output most best only entrypoints and shared bundles per entryPoint. Again do not depend on package.json exports or resolve not even main! also not index.js You want to always import a file with extension import x from '@org/my-package/index.js' not '@org/my-package' which would resolve. You want to do so because not all Environments support nodejs packages and they also should not do so it is a complicated lookup. also never use tsconfig rewrites or import maps. all this Resolve abstractions are inConsistent!

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