If you use grunt-typescript, then I have a pull request that solves this, at least for me. See https://github.com/k-maru/grunt-typescript/pull/36
From README Retrieval Request
Working with modules in node_modules (i.e. npm)
The standard way to use npm packages is to provide a definition file that points the package to typescript and imports the module from there.
import mod = module('mod')
The typescript compiler converts importto nodejs require.
var mod = require('mod')
,
npm npm
, .
node_modules grunt
import npm ,
npm,
.
import npm typescript
import npmModule = module('node_modules/npmModule/foo')
- . typescript
typescript node_modules/npmModule/foo.d.ts,
-
javascript require npmModule/foo, .