dependents/node-filing-cabinet

tsLookup only resolves using AMD module system

netanelgilad opened this issue · 4 comments

var options = {
module: ts.ModuleKind.AMD
};
var host = ts.createCompilerHost({});
debug('with options: ', options);
var resolvedModule = ts.resolveModuleName(partial, filename, options, host).resolvedModule;

Currently the tsLookup function only resolves using the AMD module system. Any specific reason for that? or can we find a way to make it configurable?

Thanks for the great lib! 🍻

I was hacking together support without a lot of time for the effort. There must be a better way. Would be great to avoid sniffing the module type (es6, amd, cjs) to determine the proper configuration. Is there an es6 config value that would suffice? I imagine non-es6 module types are unlikely to use this lib; we can always add the module type sniff (making sure to reuse asts) if need be.

+1 for module type sniff

@mrjoelkemp any idea on when it might be released?
It didn't work properly on my typescript files since I use a webpack alias in my imports.

Thanks for following up. I haven't looked into it since the issue was created. I'm open to a PR that fixes the issue. Any help is appreciated.