0

I've implemented a NestJS app in Javascript without the TS support. And I would like to deploy it. I'm wondering how one can achieve that. All the documentation points to how to do that using typescript. Using a nest build command, mentioned here in this post. But there is no proper documentation for achieving this with Javascript. There is also an issue here without the proper answer.

Here are the current scripts in my project

"scripts": {
    "format": "prettier --write \"**/*.js\"",
    "start": "babel-node index.js",
    "start:dev": "nodemon",
    "test": "jest",
    "test:cov": "jest --coverage",
    "test:e2e": "jest --config ./test/jest-e2e.json"
  },

I believe I should not be using babel in production env. I should be building the app files and use node dist/main. But how can I build the app?

Parag Pawar
  • 827
  • 3
  • 12
  • 23

1 Answers1

0

You'll still need babel-node in production, because babel is what allows you to make use of the decorators that are a non-standard feature in node. So long as you move your src/,index.js,package.json and lock-file, install production dependencies on your server, then you should be able to just babel-node index.js and have it working

Jay McDoniel
  • 57,339
  • 7
  • 135
  • 147