1

How can I combine multiple files into a single module ? Say I have a folder with multiple typescript classes e.g.

app
  module1
    foo1.ts
    foo2.ts
    ....
    module1.ts

In any classes which uses any of the module1 defined classes, I would like to be able to include the dependencies using a single import like

import {Foo1, Foo2} from "./module1/module1"

rather than importing individual classes like

 import {Foo1} from "./module1/foo1"
 import {Foo2} from "./module1/foo2"

How can I do this ?

Jesper Kristiansen
  • 1,759
  • 3
  • 17
  • 29

1 Answers1

2

Not sure if this is the correct way, but it seems to work for what I need in module1.ts simply define export for the classes

export * from "./foo1";
export * from "./foo2";
Jesper Kristiansen
  • 1,759
  • 3
  • 17
  • 29