• Home
  • Jobs
  • Courses
  • Questions
  • Teachers
  • For business
  • ES/EN

0

54
Views
tsc not compiling all js files

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?

about 1 month ago ·

Juan Pablo Isaza

Answer question
Find remote jobs
Loading

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2022 PeakU Inc. All Rights Reserved.