JavaScript module systems: share code between Node, Angular, and older packages


Details
With monorepo tools like Nx, and cross-platform testing tools like Jest, the lines between browser and Node.js code begin to blur and disappear. This has many great benefits, but also a few remaining pitfalls. Today we will examine the issue of incompatible JavaScript module systems and see how to safely handle or avoid these issues. We’ll start with a case study of using an old favorite—Lodash—within a library shared between a NodeJS and Angular App. Then we will go on to discuss general strategies for consuming or producing libraries for multiple environments.
Chris Hardin is a software developer and Angular Boot Camp instructor at Oasis Digital. She has been writing web applications and teaching others for nearly two decades, specializing in Angular for the last 7 years. Chris often assists struggling projects, identifying and resolving issues with reliability and team effectiveness.

JavaScript module systems: share code between Node, Angular, and older packages