When attempting to define extension methods in separate files and import them through a barrel file, the methods don't seem to be added to the prototype.
The following approach works:
import './rxjs-extensions/my-observable-extension-1';
import './rxjs-extensions/my-observable-extension-2';
//...
obs
.extension1()
.extension2();
However, if a barrel file is created:
// rxjs-extensions/index.ts
export * from './my-observable-extension-1';
export * from './my-observable-extension-2';
and then only the barrel file is imported
import './rxjs-extensions';
//...
obs
.extension1()
.extension2();
A run-time error occurs stating that extension1 is not a function.
What could be the issue here? Is it feasible to use a barrel file for importing extension methods in this manner?