I have classes defined within an ES6 module, how would i instantiate and use these classes from within non-modular code?

Viewed 29

I have two libraries written in TypeScript.

The first is a legacy library which i plan to incrementally convert to using ES6 modules; however, at the moment this code is pre ES6 and is not written in a modular fashion, instead using TypeScript namespaces.

Additionally, I have written a new library which has been written modularly with ES6 modules. I want to use some of the classes contained in the new ES6 library from within my older non-modular library.

I do not use any any build tools like WebPack nor am I interested in Webpack based solutions, i prefer a non-bundler based solution, but am willing to consider newer, more targeted, bundlers like Rollup, etc... I am looking for the simplest, most straight-forward solution.

Lastly, since both libraries are written in TypeScript I want the result of any solution to fully support the use of Type Definitions. Is there anyone out there with experience related to this that can provide me guidance?

0 Answers
Related