How to include dependent types in library build?

This page summarizes the projects mentioned and recommended in the original post on /r/typescript

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • tsdx

    Zero-config CLI for TypeScript package development

  • I'd just add the types as a dependency but if you want to bundle them then afaik https://github.com/jaredpalmer/tsdx can do it (though I have never tried).

  • recursive-proxy-mock

    Create a proxy which can mock any object, function, class, etc. with infinite depth and combinations.

  • Let's take a specific example. One of my libraries recursive-proxy-mock is bundled with Rollup. If you take a look at dist/cjs/index.js you can see there is one big file with everything in it, all bundled together. There are named exports for each thing. This can easily have unused code eliminated either via tree shaking or dead code elimination. I've never made a distinction as to which applies in which scenario since both should always be used together. But I guess my point is, a bundled library doesn't need to have any special format which would require a bundlers help to drop dead code.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts