feathers icon indicating copy to clipboard operation
feathers copied to clipboard

Deploy feathers Typescript app on Heroku

Open akashbudhia opened this issue 4 years ago • 0 comments

Modify your packages.json script(assuming this is from the feathers cli generator boilerplate) as follows:

"scripts": {
    "test": "npm run compile && npm run mocha",
    "dev": "ts-node-dev --no-notify src/",
    "start": "node lib/",
    "mocha": "ts-mocha \"test/*/.ts\" --recursive --exit",
    "compile": "shx rm -rf lib/ && tsc",
    "build": "npm run compile"
  }

Notice, i added a build script here. And removed the compile command from the start script.

Explanation: heroku would install the devDependencies before the npm build is run and prune this after the build has succeeded. npm start just need to serve the compiled lib folder.

@daffl if you'd like to update the generator accordingly.

akashbudhia avatar May 05 '20 19:05 akashbudhia