-
Notifications
You must be signed in to change notification settings - Fork 12
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
Require should also look for .d.ts files #29
Comments
hm I doubt that is a valid ts syntax normally d.ts files declare external modules that you should use in require instead of the file path, am I wrong ? |
If you compile .ts files to .d.ts files, requires will reference a .d.ts files. Example:
other.ts:
compiles to:
other.d.ts:
If you move all the definition files to another folder, the require references to a .d.ts file. The tsc command does look for definition files. |
This can be used to publish a package written in typescript on npm. In the package you include the compiled javascript and the definition files, and a definitions.d.ts file. From another file, that requires the package, you reference the definitions.d.ts file. The contents of definitions.d.ts:
|
If you compile a .ts file to a definitions file (.d.ts), and open that file in Brackets, you will see errors on the require calls.
Example:
import someFile = require('./someFile');
(and in the same directory there is also a file named
someFile.d.ts
)The text was updated successfully, but these errors were encountered: