Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load external module that has been transpiled from Typescript and that is required from my app #52

Open
lucaoliano opened this issue Jun 6, 2016 · 2 comments

Comments

@lucaoliano
Copy link

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 a require('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.

@lucaoliano lucaoliano changed the title Unable to load external module that has been transpiled from Typescript and required from my app Unable to load external module that has been transpiled from Typescript and that is required from my app Jun 6, 2016
@dignifiedquire
Copy link
Member

This sounds like an issue with Typescript. How should the resolver for require know that 'filename' is not what it ahould load

@lucaoliano
Copy link
Author

In the pull request #53, I've proposed a solution to solve it.

My proposal is configure into Karma configuration, which module resolves the file required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants