Skip to content

Commit 3804d26

Browse files
committed
native node_modules support
1 parent 9f55d18 commit 3804d26

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

README.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,25 +91,8 @@ Shortcut: `F6`. If there are any errors they are shown as well.
9191

9292
![](https://raw.githubusercontent.com/TypeStrong/atom-typescript/master/docs/screens/build%20errors.png)
9393

94-
## `package.json` Support
95-
Where a sample `package.json` (anywhere next to or above a `tsconfig.json`) looks like:
96-
```json
97-
{
98-
"name": "awesome",
99-
"main": "./dist/foo.js",
100-
"typescript": {
101-
"definition": "awesome.d.ts"
102-
}
103-
}
104-
```
105-
106-
We would generate a `awesome.d.ts` file for you *on build* so that other TypeScript projects can do a simple `require('awesome')`.
107-
108-
We have a sample NPM module : https://github.com/basarat/ts-npm-module and its usage is demoed in https://github.com/basarat/ts-npm-module-consume.
109-
110-
Notes:
111-
* Relative paths in `definition` are not supported. This is due to a limitation in how the TypeScript compiler does file lookup.
112-
* Other people will be able to do `require('awesome')` only if their IDE supports looking at `node_modules` like we do. Otherwise they can always explicitly `/// <reference` your `awesome.d.ts` that we generate to get the same effect.
94+
## NPM Module Support
95+
We have a sample NPM module : https://github.com/basarat/ts-npm-module (trick : in tsconfig have `"declaration" : true` an in package.json have a `typings` field pointing to the `main` file) and its usage is demoed in https://github.com/basarat/ts-npm-module-consume.
11396

11497
## React Support
11598

0 commit comments

Comments
 (0)