---
title: "Discussion on \"How To Use an ESM dependency in a library that exports ESM+CJS\" | Hashnode"
description: "Discussion on \"How To Use an ESM dependency in a library that exports ESM+CJS\". Learn how to use an ESM dependency in a library that exports both ESM and CJS with TSUP bundler"
url: "https://hashnode.com/posts/how-to-use-an-esm-dependency-in-a-library-that-exports-esmcjs/67611779139f9a95888afec4"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How To Use an ESM dependency in a library that exports ESM+CJS](https://rlee.dev/how-to-use-an-esm-dependency-in-a-library-that-exports-esmcjs?utm_source=hashnode&utm_medium=feed)

Learn how to use an ESM dependency in a library that exports both ESM and CJS with TSUP bundler

Dec 17, 2024 · 2 min read · rlee.dev  
Read the article

-   [#typescript](https://hashnode.com/tag/typescript)
-   [#esm](https://hashnode.com/tag/esm)
-   [#cjs](https://hashnode.com/tag/cjs)

## Written by

[Ryan Lee](https://hashnode.com/@ryanleecode)

@ryanleecode · Toronto, CA

  
[View profile](https://hashnode.com/@ryanleecode)

Full Stack Developer writing about functional programming, AI, and blockchain.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
