I'm having an issue compiling all the typescript files + javascript files into javascript files. it's not compiling all the javascript files to the dist folder.
here is the command I run:
rm -rf ./dist && tsc -p . && node ./dist/server.js
and I get this error:
Unhandled rejection Error: Cannot find module './email-service'
then I went to the folder email-service
and I can't find the index.js
file in there, it wasn't compiled.
here is my tsconfig file:
{
"compilerOptions": {
"outDir": "./dist",
"rootDir": ".",
"module": "commonjs",
"target": "es6",
"lib": ["dom", "es6"],
"sourceMap": true,
"checkJs": false,
"allowJs": true,
"moduleResolution": "node",
"noEmit": false,
"baseUrl": "./src",
"strict": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"isolatedModules": true,
"importHelpers": true,
"declaration": true,
"strictPropertyInitialization": false,
"alwaysStrict": true,
"paths": {
"~/*": ["*"]
},
},
"include": [ "*.js", "*.ts", "*.json"],
"exclude": ["node_modules", "dist"]
}
node version: 10.16.1
Folder Structure :
.
├── tsconfig.json
├── _src
│ └──_ email-service
│ └── index.js (missing)
├── _dist
│ └──_src
│ └──_ email-service
│ └── index.js
any idea whats the issue?