I seem to be missing something in my setup and would appreciate any assistance. I am working with TypeScript 2 + JSPM. I have tried various configurations in tsconfig using typeRoots and types (including adding the version number in the type name). Despite this, my current configuration is not functioning as expected...
package.json
"jspm": {
"dependencies": {
"lodash": "npm:lodash@^4.17.4"
},
"devDependencies": {
"@types/lodash": "npm:@types/lodash@^4.14.45",
"babel": "npm:babel-core@^5.8.24",
"babel-runtime": "npm:babel-runtime@^5.8.24",
"core-js": "npm:core-js@^1.1.4",
"systemjs": "npm:systemjs@^0.19.41"
}
}
tsconfig.json
"typeRoots": [
"jspm_packages/npm/@types"
]
The compiler does not recognize
import * as _ from "lodash"
This results in
Cannot find module 'lodash'.
As per the TypeScript documentation https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html
Interestingly, if I remove the import, VS Code is still able to locate the merge method definition (F12) when I use the following code
_.merge(a, b);
However, the compiler continues to throw an error saying
Identifier '_' must be imported from a module
Any suggestions? :)