I can't figure out why TypeScript isn't compiling anything that's inside the node_modules folder.
Here is my tsconfig.json:
{
"compilerOptions": {
"rootDir": ".",
"baseUrl": ".",
"paths": {
"shared": ["./src/shared"],
"client": ["./src/client"],
"server": ["./src/server"],
"express": ["./node_modules/express"]
},
"plugins": [
{"transform": "ts-transformer-imports"}
],
"esModuleInterop": true,
"allowJs": true,
"target": "es2015",
"module": "commonjs",
"outDir": "./build"
},
"files": ["./src/server/app.ts"]
}
Inside src/server/app.ts I import both express and shared:
import shared from 'shared';
import express from 'express';
The compilation succeeds, and compiled code for shared and server are generated. But, for some reason, the code for express isn't generated!?
This makes absolutely no sense to me... does it randomly decide to not compile something just because it's in a folder called node_modules?
How can I fix this?
Edit: I also tried changing it to "express/*": ["./node_modules/express/*"] in the config file, which didn't make any difference. (I don't know why it would, but I found that somewhere on the internet)