W
W
Wasya UK2018-03-31 13:48:48
JavaScript
Wasya UK, 2018-03-31 13:48:48

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

tsconfig.json configuration :
{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es5",
    "noImplicitAny": true,
    "outDir": "./dist",
    "rootDir": "src/_server",
    "sourceMap": true
  },
  "typeRoots": [ "node_modules/@types" ],
  "include": [
    "./src/_server/**/*"
  ]
}

The script in package.json does not create the file:
"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 question

Ask a Question

731 491 924 answers to any question