Answer the question
In order to leave comments, you need to log in
How to configure server .ts compilation?
How to correctly write a script in package.json to compile server.ts into server.js , while moving it to another folder?
Project structure:
Project
--dist
----server.js ( compiled version )
--src
----_server
------server.ts
--package.json
--tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"noImplicitAny": true,
"outDir": "./dist",
"rootDir": "src/_server",
"sourceMap": true
},
"typeRoots": [ "node_modules/@types" ],
"include": [
"./src/_server/**/*"
]
}
"watch-server": "nodemon --watch 'src/_server/**/*' -e ts,tsx --exec ts-node ./src/_server/server.ts",
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question