Closed
Description
Hi,
I would know what are the possibilities and reservations for having a sort of module resolution
when compiling a project with --module=amd
The context:
- This is about NodeJS and NPM modules
- I am developing a fairly large library that is distributed as an NPM module
- The project ultimately compiles down to a single js file and a single d.ts file.
- The framework consist of many classes, one class per file, and the classes are organized in various namspaces (like we do it in .NET)
- At the consumer side, after installing the lib with
npm install --save
I usetypings install --save --global file:node_modules/path/to/lib.d.ts
The problem and the request
- I use statements like
var fs = require('fs');
at the top of some classes. This works at runtime just fine but at develop time, I don't get "intellisense" from VSCode for example, even with adding/// ref
and installingdt~node
withtypings
. The compiler sees 'fs' as 'any' becauserequire("fs"
) is not resolved to an external module.
I understand that is about module resolution and emitting somekind of require
statement, but would it be possible to implement such module resolution (just for the sake of intellisense) in the compiler.
Any thoughts?
Thanks.