Quick tip with Typescript, Use moduleResolution

https://www.typescriptlang.org/docs/handbook/module-resolution.html

One of the first items to not miss or be confused about when starting a typescript project is to set up the tsconfig.json to contain how to resolve the paths for inclusion in the app being built.

In my case, being reminded to use the node resolution strategy for importing from the node_modules folder was a requirement.

1
2
3
4
5
6
7
8
{
"compilerOptions": {
"target": "es2017",
"module": "es2015",
"sourceMap": true,
"moduleResolution": "node"
}
}

Also see some further examples here.
https://github.com/chanon/typescript_module_example