I am building a big library with Typescript with like 100 separate ts files. Previously I used export module XXX (renamed to export namespace XXX later) for all my classes, but as books say, this is not a recommended way, I should use import instead.
So I tried importing. This worked fine:
import * as mylib from "./source/source.ts";
But as I have 100 files, I don't want to add such a line for all of them. And I want all my classes to be accessible through mylib variable.
So I tried this:
import * as mylib from "./source/";
But as soon as I do this, I get: Cannot find module './source/'
Is there a way to import all the classes from a folder with multiple files with a single line?