Open lucaoliano opened 8 years ago
This sounds like an issue with Typescript. How should the resolver for require know that 'filename' is not what it ahould load
In the pull request https://github.com/karma-runner/karma-commonjs/pull/53, I've proposed a solution to solve it.
My proposal is configure into Karma configuration, which module resolves the file required.
I have an external npm common module, shared from all my apps, that is wirtten in Typescript. Supposing that this module is called
common_module
, when I build it, the transpiler for each typescript import generates arequire('file_name')
. When karma-commonjs tries to resolve these require, it searches for something like.../node_modules/file_name
, but the module is located at.../node_modules/common_module
.